rawclient

package
v0.0.0-...-76fd5c9 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeleteHandler

type DeleteHandler func(error, time.Duration)

type GetHandler

type GetHandler func(uint64, error, time.Duration)

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 PutHandler

type PutHandler func(uint64, error, time.Duration)

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.

func (*RawClient) Delete

func (c *RawClient) Delete(ctx context.Context, containerID cid.ID, objectID oid.ID) error

func (*RawClient) Get

func (c *RawClient) Get(ctx context.Context, containerID cid.ID, objectID oid.ID) (*object.Object, error)

func (*RawClient) OwnerID

func (c *RawClient) OwnerID() *user.ID

func (*RawClient) Put

func (c *RawClient) Put(ctx context.Context, containerID cid.ID, ownerID *user.ID, headers map[string]string, payload []byte) (oid.ID, error)

Jump to

Keyboard shortcuts

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