wrapper

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2021 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client = container.Client

Client represents the Container contract client.

It is a type alias of github.com/nspcc-dev/neofs-node/pkg/morph/client/container.Client.

type Estimation added in v0.15.0

type Estimation struct {
	Size uint64

	Reporter []byte
}

Estimation is a structure of single container load estimation reported by storage node.

type EstimationID added in v0.15.0

type EstimationID []byte

EstimationID is an identity of container load estimation inside Container contract.

type Estimations added in v0.15.0

type Estimations struct {
	ContainerID *container.ID

	Values []Estimation
}

Estimation is a structure of grouped container load estimation inside Container contract.

type Wrapper

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

Wrapper is a wrapper over container contract client which implements container storage and eACL storage methods.

Working wrapper must be created via constructor New. Using the Wrapper that has been created with new(Wrapper) expression (or just declaring a Wrapper variable) is unsafe and can lead to panic.

func New

func New(c *Client) (*Wrapper, error)

New creates, initializes and returns the Wrapper instance.

If Client is nil, container.ErrNilClient is returned.

func (*Wrapper) AnnounceLoad added in v0.15.0

func (w *Wrapper) AnnounceLoad(a container.UsedSpaceAnnouncement, key []byte) error

AnnounceLoad saves container size estimation calculated by storage node with key in NeoFS system through Container contract call.

Returns any error encountered that caused the saving to interrupt.

func (*Wrapper) Delete

func (w *Wrapper) Delete(cid *container.ID, signature []byte) error

Delete removes the container from NeoFS system through Container contract call.

Returns any error encountered that caused the removal to interrupt.

func (*Wrapper) Get

func (w *Wrapper) Get(cid *container.ID) (*container.Container, error)

Get reads the container from NeoFS system by identifier through Container contract call.

If an empty slice is returned for the requested identifier, storage.ErrNotFound error is returned.

func (*Wrapper) GetEACL

func (w *Wrapper) GetEACL(cid *containerSDK.ID) (*eacl.Table, *pkg.Signature, error)

GetEACL reads the extended ACL table from NeoFS system through Container contract call.

func (*Wrapper) GetUsedSpaceEstimations added in v0.15.0

func (w *Wrapper) GetUsedSpaceEstimations(id EstimationID) (*Estimations, error)

GetUsedSpaceEstimations returns a list of container load estimations by ID. The list is composed through Container contract call.

func (*Wrapper) List

func (w *Wrapper) List(ownerID *owner.ID) ([]*container.ID, error)

List returns a list of container identifiers belonging to the specified owner of NeoFS system. The list is composed through Container contract call.

Returns the identifiers of all NeoFS containers if pointer to owner identifier is nil.

func (*Wrapper) ListLoadEstimationsByEpoch added in v0.15.0

func (w *Wrapper) ListLoadEstimationsByEpoch(epoch uint64) ([]EstimationID, error)

ListLoadEstimationsByEpoch returns a list of container load estimations for to the specified epoch. The list is composed through Container contract call.

func (*Wrapper) Put

func (w *Wrapper) Put(cnr *container.Container, pubKey, signature []byte) (*container.ID, error)

Put saves passed container structure in NeoFS system through Container contract call.

Returns calculated container identifier and any error encountered that caused the saving to interrupt.

func (*Wrapper) PutEACL

func (w *Wrapper) PutEACL(table *eacl.Table, signature []byte) error

PutEACL saves the extended ACL table in NeoFS system through Container contract call.

Returns any error encountered that caused the saving to interrupt.

func (*Wrapper) StartEstimation added in v0.15.0

func (w *Wrapper) StartEstimation(epoch uint64) error

StartEstimation votes to produce start estimation notification.

func (*Wrapper) StopEstimation added in v0.15.0

func (w *Wrapper) StopEstimation(epoch uint64) error

StopEstimation votes to produce stop estimation notification.

Jump to

Keyboard shortcuts

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