forked from TrueCloudLab/frostfs-api-go
580f6c5554
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>
19 lines
385 B
Go
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
|
|
}
|
|
}
|