Documentation ¶
Index ¶
- func AsContainerSource(w *Wrapper) core.Source
- func Delete(w *Wrapper, witness core.RemovalWitness) error
- func Get(w *Wrapper, cid *cid.ID) (*container.Container, error)
- func Put(w *Wrapper, cnr *container.Container) (*cid.ID, error)
- func PutEACL(w *Wrapper, table *eacl.Table) error
- type Estimation
- type EstimationID
- type Estimations
- type Option
- type Wrapper
- func (w *Wrapper) AnnounceLoad(a container.UsedSpaceAnnouncement, key []byte) error
- func (w *Wrapper) Delete(cid, signature, token []byte) error
- func (w *Wrapper) Get(cid []byte) (*container.Container, error)
- func (w *Wrapper) GetEACL(cid *cid.ID) (*eacl.Table, error)
- func (w *Wrapper) GetUsedSpaceEstimations(id EstimationID) (*Estimations, error)
- func (w *Wrapper) List(ownerID *owner.ID) ([]*cid.ID, error)
- func (w *Wrapper) ListLoadEstimationsByEpoch(epoch uint64) ([]EstimationID, error)
- func (w *Wrapper) Put(cnr, key, sig, token []byte) error
- func (w *Wrapper) PutEACL(table, key, sig, token []byte) error
- func (w *Wrapper) StartEstimation(epoch uint64) error
- func (w *Wrapper) StopEstimation(epoch uint64) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AsContainerSource ¶ added in v0.21.0
AsContainerSource provides container Source interface from Wrapper instance.
func Delete ¶ added in v0.21.0
func Delete(w *Wrapper, witness core.RemovalWitness) error
Delete marshals container ID, and passes it to Wrapper's Delete method along with signature and session token.
Returns error if container ID is nil.
func Get ¶ added in v0.21.0
Get marshals container ID, and passes it to Wrapper's Get method.
Returns error if cid is nil.
Types ¶
type Estimation ¶ added in v0.15.0
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 *cid.ID Values []Estimation }
Estimations is a structure of grouped container load estimation inside Container contract.
type Option ¶ added in v0.21.0
type Option func(*opts)
Option allows to set an optional parameter of ClientWrapper.
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 NewFromMorph ¶ added in v0.21.0
func NewFromMorph(cli *client.Client, contract util.Uint160, fee fixedn.Fixed8, opts ...Option) (*Wrapper, error)
NewFromMorph returns the wrapper instance from the raw morph client.
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 ¶
Delete removes the container from NeoFS system through Container contract call.
Returns any error encountered that caused the removal to interrupt.
If TryNotary is provided, calls notary contract.
func (*Wrapper) Get ¶
Get reads the container from NeoFS system by binary identifier through Container contract call.
If an empty slice is returned for the requested identifier, storage.ErrNotFound error is returned.
func (*Wrapper) GetEACL ¶
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 ¶
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 ¶
Put saves binary container with its session token, key and signature in NeoFS system through Container contract call.
Returns calculated container identifier and any error encountered that caused the saving to interrupt.
If TryNotary is provided, calls notary contract.
func (*Wrapper) PutEACL ¶
PutEACL saves binary eACL table with its session token, key and signature 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
StartEstimation votes to produce start estimation notification.
func (*Wrapper) StopEstimation ¶ added in v0.15.0
StopEstimation votes to produce stop estimation notification.