Andrey Smirnov c55142668f feat: migrate grpc-middleware to v2, update deps
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>
2024-03-12 18:14:14 +04:00

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
}