container

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2020 License: GPL-3.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

View Source
const OwnerIDSize = refs.OwnerIDSize

OwnerIDSize is a size of OwnerID in a binary form.

Variables

View Source
var ErrNilContainer = errors.New("container is nil")

ErrNilContainer is the error returned by functions that expect a non-nil container pointer, but received nil.

Functions

This section is empty.

Types

type BasicACL

type BasicACL = basic.ACL

BasicACL represents the basic ACL rules.

It is a type alias of github.com/nspcc-dev/neofs-node/pkg/core/container/basic.ACL.

type Container

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

Container represents NeoFS container.

func (*Container) BasicACL

func (c *Container) BasicACL() BasicACL

BasicACL returns the mask of basic container permissions.

func (*Container) MarshalBinary

func (c *Container) MarshalBinary() ([]byte, error)

MarshalBinary encodes the container into a binary form and returns the result.

func (*Container) OwnerID

func (c *Container) OwnerID() OwnerID

OwnerID returns an ID of the container's owner.

func (*Container) PlacementRule

func (c *Container) PlacementRule() PlacementRule

PlacementRule returns placement rule of the container.

func (*Container) Salt

func (c *Container) Salt() []byte

Salt returns the container salt.

Slice is returned by reference without copying.

func (*Container) SetBasicACL

func (c *Container) SetBasicACL(v BasicACL)

SetBasicACL sets the mask of basic container permissions.

func (*Container) SetOwnerID

func (c *Container) SetOwnerID(v OwnerID)

SetOwnerID sets the ID of the container's owner.

func (*Container) SetPlacementRule

func (c *Container) SetPlacementRule(v PlacementRule)

SetPlacementRule sets placement rule of the container.

func (*Container) SetSalt

func (c *Container) SetSalt(v []byte)

SetSalt sets the container salt.

Slice is assigned by reference without copying.

func (*Container) UnmarshalBinary

func (c *Container) UnmarshalBinary(data []byte) error

UnmarshalBinary unmarshals container from a binary representation.

If buffer size is insufficient, io.ErrUnexpectedEOF is returned.

type ID

type ID = refs.CID

ID represents the container identifier.

It is a type alias of github.com/nspcc-dev/neofs-api-go/refs.CID. FIXME: container id should be defined in core package.

func CalculateID

func CalculateID(cnr *Container) (*ID, error)

CalculateID calculates container identifier as SHA256 checksum of the binary form.

If container is nil, ErrNilContainer is returned.

type OwnerID

type OwnerID = refs.OwnerID

OwnerID represents the container owner identifier.

It is a type alias of github.com/nspcc-dev/neofs-api-go/refs.OwnerID. FIXME: owner ID should be defined in core lib.

type PlacementRule

type PlacementRule = netmap.PlacementRule

PlacementRule represents placement rules of the container.

It is a type alias of github.com/nspcc-dev/netmap.PlacementRule. FIXME: container placement rules should be defined in core lib.

Directories

Path Synopsis
acl

Jump to

Keyboard shortcuts

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