subnet

package
v1.0.0-rc.4 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IDEquals

func IDEquals(info Info, id subnetid.ID) bool

IDEquals checks if ID refers to subnet that Info describes.

func IsOwner

func IsOwner(info Info, id user.ID) bool

IsOwner checks subnet ownership.

Types

type Info

type Info subnet.Info

Info represents information about NeoFS subnet.

The type is compatible with the corresponding message from NeoFS API V2 protocol.

Zero value and nil pointer to it represents zero subnet w/o an owner.

func (*Info) FromV2

func (x *Info) FromV2(msg subnet.Info)

FromV2 initializes Info from subnet.Info message structure. Must not be called on nil.

func (*Info) Marshal

func (x *Info) Marshal() ([]byte, error)

Marshal encodes Info into a binary format of NeoFS API V2 protocol (Protocol Buffers with direct field order).

func (Info) ReadID

func (x Info) ReadID(id *subnetid.ID)

ReadID reads the identifier of the subnet that Info describes. Arg must not be nil.

func (Info) ReadOwner

func (x Info) ReadOwner(id *user.ID)

ReadOwner reads the identifier of the subnet that Info describes. Must be called only if owner is set (see HasOwner). Arg must not be nil.

func (*Info) SetID

func (x *Info) SetID(id subnetid.ID)

SetID sets the identifier of the subnet that Info describes.

func (*Info) SetOwner

func (x *Info) SetOwner(id user.ID)

SetOwner sets subnet owner ID.

func (*Info) Unmarshal

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

Unmarshal decodes Info from NeoFS API V2 binary format (see Marshal). Must not be called on nil.

Note: empty data corresponds to zero Info value or nil pointer to it.

func (Info) WriteToV2

func (x Info) WriteToV2(msg *subnet.Info)

WriteToV2 writes Info to subnet.Info message structure. The message must not be nil.

Directories

Path Synopsis
id

Jump to

Keyboard shortcuts

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