Documentation
¶
Index ¶
- func AsContainerSource(w *Client) containercore.Source
- func Get(c *Client, cnr cid.ID) (container.Container, error)
- type Client
- func (c Client) ContractAddress() util.Uint160
- func (c *Client) Delete(p DeletePrm) error
- func (c *Client) Get(cid []byte) (container.Container, error)
- func (c *Client) GetContainerQuota(cID cid.ID) (Quota, error)
- func (c *Client) GetEACL(cnr cid.ID) (eacl.Table, error)
- func (c *Client) GetReportsSummary(cID cid.ID) (Summary, error)
- func (c *Client) GetTakenSpaceByUser(user user.ID) (uint64, error)
- func (c *Client) GetUserQuota(user user.ID) (Quota, error)
- func (c *Client) List(idUser *user.ID) ([]cid.ID, error)
- func (c Client) Morph() *client.Client
- func (c *Client) NodeReports(cID cid.ID) ([]Report, error)
- func (c *Client) Nodes(cid cid.ID) ([][]*keys.PublicKey, error)
- func (c *Client) Put(p PutPrm) error
- func (c *Client) PutEACL(p PutEACLPrm) error
- func (c *Client) PutReport(cID cid.ID, storageSize, objsNumber uint64, key []byte) error
- func (c *Client) SubmitObjectPut(meta []byte, sigs [][][]byte) error
- func (c *Client) UpdateContainerPlacement(cid cid.ID, vectors [][]netmap.NodeInfo, replicas []uint32) error
- type DeletePrm
- type Option
- type PutEACLPrm
- type PutPrm
- type Quota
- type Report
- type Summary
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.
Types ¶
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
NewFromMorph returns the wrapper instance from the raw morph client.
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 ¶
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) GetContainerQuota ¶ added in v0.49.1
GetContainerQuota returns set container size quotas according to contract state. If no limit set, zero value is retuned.
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) GetReportsSummary ¶ added in v0.49.1
GetReportsSummary returns summary report based on preceding [PutReport] calls made by storage nodes.
func (*Client) GetTakenSpaceByUser ¶ added in v0.49.1
GetTakenSpaceByUser returns a sum of all taken space in every container that belongs to user.
func (*Client) GetUserQuota ¶ added in v0.49.1
GetUserQuota returns set user size quotas according to contract state. If no limit set, zero value is retuned.
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) NodeReports ¶ added in v0.49.1
NodeReports returns a list of container load reports. The list is composed through Container contract call.
func (*Client) Nodes ¶ added in v0.49.1
Nodes returns container nodes placement from the Container contract. Result is a two-dimensional array corresponding to placement vectors. Returns (nil, nil) if there is no information from the contract.
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) PutReport ¶ added in v0.49.1
PutReport saves container state reported by storage node with key in NeoFS system through Container contract call.
Returns any error encountered that caused the saving to interrupt.
func (*Client) SubmitObjectPut ¶ added in v0.45.0
SubmitObjectPut puts object meta information.
Returns any error encountered that caused the saving to interrupt.
func (*Client) UpdateContainerPlacement ¶ added in v0.45.0
func (c *Client) UpdateContainerPlacement(cid cid.ID, vectors [][]netmap.NodeInfo, replicas []uint32) error
UpdateContainerPlacement registers public keys as a container's placement vectors. Always sends a notary request with Alphabet multi-signature. Number of vectors must equal number of replicas. Empty vectors removes container placement from the contract.
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 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.
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) EnableMeta ¶ added in v0.45.0
func (p *PutPrm) EnableMeta()
EnableMeta enables meta-on-chain.
func (*PutPrm) SetContainer ¶ added in v0.28.0
SetContainer sets container data.
func (*PutPrm) SetSignature ¶ added in v0.28.0
SetSignature sets signature.
type Quota ¶ added in v0.49.1
Quota represents set quota limits.
func (*Quota) FromStackItem ¶ added in v0.49.1
FromStackItem implements stackitem.Convertible.