frostfs-api-go/subnet/grpc/types.go
Leonard Lyubich 580f6c5554 [#355] subnet: Implement types for the new messages
Define `subnet.Info` structure of corresponding message from NeoFS API
protocol. Provide field getters and setters. Implement
`StableMarshal` / `StableSize` methods of binary encoding. Implement
`ToGRPCMessage` / `FromGRPCMessage` method for testing and
potential transport.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-11-18 17:40:33 +03:00

19 lines
385 B
Go

package subnet
import (
refs "github.com/nspcc-dev/neofs-api-go/v2/refs/grpc"
)
// SetID returns identifier of the subnet. Nil arg is equivalent to zero subnet ID.
func (x *SubnetInfo) SetID(id *refs.SubnetID) {
if x != nil {
x.Id = id
}
}
// SetOwner sets subnet owner's ID in NeoFS system.
func (x *SubnetInfo) SetOwner(id *refs.OwnerID) {
if x != nil {
x.Owner = id
}
}