forked from TrueCloudLab/frostfs-node
[#645] core/client: Add public key to NodeInfo structure
There is a need to process announced public keys of storage nodes for intra-container communication. Implement `PublicKey` / `SetPublicKey` methods of `client.NodeInfo` type. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
7b228b7603
commit
4ec7e24b85
1 changed files with 16 additions and 0 deletions
|
@ -19,6 +19,8 @@ type Client interface {
|
|||
// NodeInfo groups information about NeoFS storage node needed for Client construction.
|
||||
type NodeInfo struct {
|
||||
addrGroup network.AddressGroup
|
||||
|
||||
key []byte
|
||||
}
|
||||
|
||||
// SetAddressGroup sets group of network addresses.
|
||||
|
@ -30,3 +32,17 @@ func (x *NodeInfo) SetAddressGroup(v network.AddressGroup) {
|
|||
func (x NodeInfo) AddressGroup() network.AddressGroup {
|
||||
return x.addrGroup
|
||||
}
|
||||
|
||||
// SetPublicKey sets public key in a binary format.
|
||||
//
|
||||
// Argument must not be mutated.
|
||||
func (x *NodeInfo) SetPublicKey(v []byte) {
|
||||
x.key = v
|
||||
}
|
||||
|
||||
// PublicKey returns public key in a binary format.
|
||||
//
|
||||
// Result must not be mutated.
|
||||
func (x *NodeInfo) PublicKey() []byte {
|
||||
return x.key
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue