subnet

package
v2.14.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 17, 2022 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Info

type Info struct {
	// contains filtered or unexported fields
}

Info represents information about NeoFS subnet. Structure is compatible with NeoFS API V2 protocol.

Zero value represents zero subnet w/o an owner.

func (*Info) FromGRPCMessage

func (x *Info) FromGRPCMessage(m grpc.Message) error

FromGRPCMessage restores Info from grpc.Message.

Supported types:

  • subnet.SubnetInfo.

func (*Info) ID

func (x *Info) ID() *refs.SubnetID

ID returns identifier of the subnet. Nil return is equivalent to zero subnet ID.

func (*Info) Owner

func (x *Info) Owner() *refs.OwnerID

Owner returns subnet owner's ID in NeoFS system.

func (*Info) SetID

func (x *Info) SetID(id *refs.SubnetID)

SetID returns identifier of the subnet. Nil arg is equivalent to zero subnet ID.

func (*Info) SetOwner

func (x *Info) SetOwner(id *refs.OwnerID)

SetOwner sets subnet owner's ID in NeoFS system.

func (*Info) StableMarshal

func (x *Info) StableMarshal(buf []byte) []byte

StableMarshal marshals Info to NeoFS API V2 binary format (Protocol Buffers with direct field order).

Returns a slice of recorded data. Data is written to the provided buffer if there is enough space.

func (*Info) StableSize

func (x *Info) StableSize() (size int)

StableSize returns the number of bytes required to write Info in NeoFS API V2 binary format (see StableMarshal).

func (*Info) ToGRPCMessage

func (x *Info) ToGRPCMessage() grpc.Message

ToGRPCMessage forms subnet.SubnetInfo message and returns it as grpc.Message.

func (*Info) Unmarshal

func (x *Info) Unmarshal(data []byte) error

Unmarshal decodes Info from NeoFS API V2 binary format (see StableMarshal).

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL