mirror of
https://github.com/siderolabs/discovery-service.git
synced 2025-03-14 09:55:08 +00:00
Update removing multiple old middlewares, rework the way data is passed through the context, logging fields, etc. Fix minimum keepalive interval enforcement. Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
30 lines
685 B
Go
30 lines
685 B
Go
// Copyright (c) 2024 Sidero Labs, Inc.
|
|
//
|
|
// Use of this software is governed by the Business Source License
|
|
// included in the LICENSE file.
|
|
|
|
package state
|
|
|
|
// AffiliateExport represents a read-only copy of affiliate.
|
|
type AffiliateExport struct {
|
|
ID string
|
|
Data []byte
|
|
Endpoints [][]byte
|
|
}
|
|
|
|
// Export the affiliate into AffiliateExport.
|
|
func (affiliate *Affiliate) Export() *AffiliateExport {
|
|
result := &AffiliateExport{
|
|
ID: affiliate.id,
|
|
Data: affiliate.data,
|
|
}
|
|
|
|
result.Endpoints = make([][]byte, 0, len(affiliate.endpoints))
|
|
|
|
for _, endpoint := range affiliate.endpoints {
|
|
result.Endpoints = append(result.Endpoints, endpoint.data)
|
|
}
|
|
|
|
return result
|
|
}
|