subnet

package
v0.0.0-...-5e759bf Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: Apache-2.0 Imports: 5 Imported by: 2

Documentation

Overview

Package subnet collects functionality related to the FrostFS subnets.

Subnet of a particular FrostFS network consists of a subset of the storage nodes of that network. Subnet of the whole network is called zero. Info type acts as a subnet descriptor. Each subnet is owned by the user who created it. Information about all subnets is stored in the Subnet contract of the FrostFS Sidechain.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertOwnership

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

AssertOwnership checks if the given info describes the subnet owned by the given user.

func AssertReference

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

AssertReference checks if the given info describes the subnet referenced by the given id.

Types

type Info

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

Info represents information about FrostFS subnet.

Instances can be created using built-in var declaration.

func (Info) ID

func (x Info) ID() subnetid.ID

ID returns subnet identifier set using SetID.

Zero Info refers to the zero subnet.

func (Info) Marshal

func (x Info) Marshal() []byte

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

See also Unmarshal.

func (Info) Owner

func (x Info) Owner() user.ID

Owner returns subnet owner set using SetOwner.

Zero Info has no owner which is incorrect according to the FrostFS API protocol.

func (*Info) SetID

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

SetID sets the identifier of the subnet that Info describes.

See also ID.

func (*Info) SetOwner

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

SetOwner sets identifier of the subnet owner.

func (*Info) Unmarshal

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

Unmarshal decodes binary Info calculated using Marshal. Returns an error describing a format violation.

Directories

Path Synopsis
id
Package subnetid provides primitives to work with subnet identification in FrostFS.
Package subnetid provides primitives to work with subnet identification in FrostFS.
test
Package subnetidtest provides functions for convenient testing of subnetid package API.
Package subnetidtest provides functions for convenient testing of subnetid package API.
Package subnettest provides functions for convenient testing of subnet package API.
Package subnettest provides functions for convenient testing of subnet package API.

Jump to

Keyboard shortcuts

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