Documentation ¶
Overview ¶
Package rawclient provides a basic interface to the local storage engine. It can be used as a base for more complex load clients backed by local storage.
Index ¶
- type DeleteHandler
- type GetHandler
- type Option
- type PutHandler
- type RawClient
- func (c *RawClient) Delete(ctx context.Context, containerID cid.ID, objectID oid.ID) error
- func (c *RawClient) Get(ctx context.Context, containerID cid.ID, objectID oid.ID) (*object.Object, error)
- func (c *RawClient) OwnerID() *user.ID
- func (c *RawClient) Put(ctx context.Context, containerID cid.ID, ownerID *user.ID, ...) (oid.ID, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeleteHandler ¶
type Option ¶
type Option func(*config)
func WithDeleteHandler ¶
func WithDeleteHandler(h DeleteHandler) Option
WithDeleteHandler sets the hook invoked on completion of Delete calls. This is useful for updating metrics or debugging.
func WithGetHandler ¶
func WithGetHandler(h GetHandler) Option
WithGetHandler sets the hook invoked on completion of Get calls. This is useful for updating metrics or debugging.
func WithKey ¶
func WithKey(key ecdsa.PrivateKey) Option
WithKey sets the private key used by the raw client if no other key is available when setting owner IDs. Required.
func WithPutHandler ¶
func WithPutHandler(h PutHandler) Option
WithPutHandler sets the hook invoked on completion of Put calls. This is useful for updating metrics or debugging.
type RawClient ¶
type RawClient struct {
// contains filtered or unexported fields
}
RawClient is a client to the local storage engine instance.
func New ¶
func New(ng *engine.StorageEngine, opts ...Option) *RawClient
New returns a RawClient from the provided options.