From 4ec7e24b85d94f1891e0f904c0142a29e2353665 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Tue, 28 Sep 2021 07:49:28 +0300 Subject: [PATCH] [#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 --- pkg/core/client/client.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/pkg/core/client/client.go b/pkg/core/client/client.go index 46504bab..2e0c3a76 100644 --- a/pkg/core/client/client.go +++ b/pkg/core/client/client.go @@ -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 +}