Documentation ¶
Index ¶
- func AsContainerSource(w *Client) containercore.Source
- func Delete(c *Client, witness core.RemovalWitness) error
- func Get(c *Client, cnr cid.ID) (*containercore.Container, error)
- func Put(c *Client, cnr containercore.Container) (*cid.ID, error)
- func PutEACL(c *Client, eaclInfo containercore.EACL) error
- type AnnounceLoadPrm
- type Client
- func (c *Client) AnnounceLoad(p AnnounceLoadPrm) error
- func (c Client) ContractAddress() util.Uint160
- func (c *Client) Delete(p DeletePrm) error
- func (c *Client) Get(cid []byte) (*containercore.Container, error)
- func (c *Client) GetEACL(cnr cid.ID) (*container.EACL, error)
- func (c *Client) List(idUser *user.ID) ([]cid.ID, error)
- func (c *Client) ListLoadEstimationsByEpoch(epoch uint64) (map[cid.ID]*Estimations, error)
- func (c Client) Morph() *client.Client
- func (c *Client) Put(p PutPrm) error
- func (c *Client) PutEACL(p PutEACLPrm) error
- func (c *Client) StartEstimation(p StartEstimationPrm) error
- func (c *Client) StopEstimation(p StopEstimationPrm) error
- type DeletePrm
- type Estimation
- type Estimations
- type Option
- type PutEACLPrm
- type PutPrm
- type StartEstimationPrm
- type StopEstimationPrm
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AsContainerSource ¶ added in v0.28.0
func AsContainerSource(w *Client) containercore.Source
AsContainerSource provides container Source interface from Wrapper instance.
func Delete ¶ added in v0.28.0
func Delete(c *Client, 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.
Types ¶
type AnnounceLoadPrm ¶ added in v0.28.0
type AnnounceLoadPrm struct { client.InvokePrmOptional // contains filtered or unexported fields }
AnnounceLoadPrm groups parameters of AnnounceLoad operation.
func (*AnnounceLoadPrm) SetAnnouncement ¶ added in v0.28.0
func (a2 *AnnounceLoadPrm) SetAnnouncement(a container.SizeEstimation)
SetAnnouncement sets announcement.
func (*AnnounceLoadPrm) SetReporter ¶ added in v0.28.0
func (a2 *AnnounceLoadPrm) SetReporter(key []byte)
SetReporter sets public key of the reporter.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a wrapper over StaticClient which makes calls with the names and arguments of the NeoFS Container contract.
Working client must be created via constructor New. Using the Client that has been created with new(Client) expression (or just declaring a Client variable) is unsafe and can lead to panic.
func NewFromMorph ¶ added in v0.28.0
func NewFromMorph(cli *client.Client, contract util.Uint160, fee fixedn.Fixed8, opts ...Option) (*Client, error)
NewFromMorph returns the wrapper instance from the raw morph client.
Specified fee is used for all operations by default. If WithCustomFeeForNamedPut is provided, the customized fee is used for Put operations with named containers.
func (*Client) AnnounceLoad ¶ added in v0.28.0
func (c *Client) AnnounceLoad(p AnnounceLoadPrm) 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 (Client) ContractAddress ¶ added in v0.28.0
ContractAddress returns the address of the associated contract.
func (*Client) Delete ¶
Delete removes the container from NeoFS system through Container contract call.
Returns any error encountered that caused the removal to interrupt.
func (*Client) Get ¶
func (c *Client) Get(cid []byte) (*containercore.Container, error)
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 (*Client) GetEACL ¶ added in v0.28.0
GetEACL reads the extended ACL table from NeoFS system through Container contract call.
Returns apistatus.EACLNotFound if eACL table is missing in the contract.
func (*Client) List ¶
List returns a list of container identifiers belonging to the specified user of NeoFS system. The list is composed through Container contract call.
Returns the identifiers of all NeoFS containers if pointer to user identifier is nil.
func (*Client) ListLoadEstimationsByEpoch ¶ added in v0.28.0
ListLoadEstimationsByEpoch returns a list of container load estimations for to the specified epoch. The list is composed through Container contract call.
func (*Client) 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.
func (*Client) PutEACL ¶ added in v0.28.0
func (c *Client) PutEACL(p PutEACLPrm) error
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 (*Client) StartEstimation ¶ added in v0.15.0
func (c *Client) StartEstimation(p StartEstimationPrm) error
StartEstimation votes to produce start estimation notification.
func (*Client) StopEstimation ¶ added in v0.15.0
func (c *Client) StopEstimation(p StopEstimationPrm) error
StopEstimation votes to produce stop estimation notification.
type DeletePrm ¶ added in v0.28.0
type DeletePrm struct { client.InvokePrmOptional // contains filtered or unexported fields }
DeletePrm groups parameters of Delete client operation.
func (*DeletePrm) SetSignature ¶ added in v0.28.0
SetSignature sets signature.
type Estimation ¶ added in v0.15.0
Estimation is a structure of single container load estimation reported by storage node.
func (*Estimation) FromStackItem ¶ added in v0.38.0
func (e *Estimation) FromStackItem(item stackitem.Item) error
FromStackItem implements stackitem.Convertible.
func (*Estimation) ToStackItem ¶ added in v0.38.0
func (e *Estimation) ToStackItem() (stackitem.Item, error)
ToStackItem implements stackitem.Convertible.
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 ¶
type Option func(*opts)
Option allows to set an optional parameter of Wrapper.
func AsAlphabet ¶ added in v0.28.0
func AsAlphabet() Option
AsAlphabet returns option to sign main TX of notary requests with client's private key.
Considered to be used by IR nodes only.
func DisableNotarySigning ¶ added in v0.38.0
func DisableNotarySigning() Option
DisableNotarySigning returns option to disable notary request signing. With that option, every call will be created, signed with provided key (a single regular sign) and sent to the side chain.
func WithCustomFeeForNamedPut ¶ added in v0.28.0
WithCustomFeeForNamedPut returns option to specify custom fee for each Put operation with named container.
type PutEACLPrm ¶ added in v0.28.0
type PutEACLPrm struct { client.InvokePrmOptional // contains filtered or unexported fields }
PutEACLPrm groups parameters of PutEACL operation.
func (*PutEACLPrm) SetKey ¶ added in v0.28.0
func (p *PutEACLPrm) SetKey(key []byte)
SetKey sets key.
func (*PutEACLPrm) SetSignature ¶ added in v0.28.0
func (p *PutEACLPrm) SetSignature(sig []byte)
SetSignature sets signature.
func (*PutEACLPrm) SetTable ¶ added in v0.28.0
func (p *PutEACLPrm) SetTable(table []byte)
SetTable sets table.
func (*PutEACLPrm) SetToken ¶ added in v0.28.0
func (p *PutEACLPrm) SetToken(token []byte)
SetToken sets session token.
type PutPrm ¶ added in v0.28.0
type PutPrm struct { client.InvokePrmOptional // contains filtered or unexported fields }
PutPrm groups parameters of Put operation.
func (*PutPrm) SetContainer ¶ added in v0.28.0
SetContainer sets container data.
func (*PutPrm) SetSignature ¶ added in v0.28.0
SetSignature sets signature.
type StartEstimationPrm ¶ added in v0.28.0
type StartEstimationPrm struct {
// contains filtered or unexported fields
}
StartEstimationPrm groups parameters of StartEstimation operation.
type StopEstimationPrm ¶ added in v0.28.0
type StopEstimationPrm struct {
// contains filtered or unexported fields
}
StopEstimationPrm groups parameters of StopEstimation operation.