neofs

package
v0.107.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// URIScheme is the name of neofs URI scheme.
	URIScheme = "neofs"
)

Variables

View Source
var (
	ErrInvalidScheme    = errors.New("invalid URI scheme")
	ErrMissingObject    = errors.New("object ID is missing from URI")
	ErrInvalidContainer = errors.New("container ID is invalid")
	ErrInvalidObject    = errors.New("object ID is invalid")
	ErrInvalidRange     = errors.New("object range is invalid (expected 'Offset|Length')")
	ErrInvalidCommand   = errors.New("invalid command")
)

Various validation errors.

Functions

func Get

func Get(ctx context.Context, priv *keys.PrivateKey, u *url.URL, addr string) (io.ReadCloser, error)

Get returns a neofs object from the provided url. URI scheme is "neofs:<Container-ID>/<Object-ID/<Command>/<Params>". If Command is not provided, full object is requested.

func GetSDKClient added in v0.107.0

func GetSDKClient(ctx context.Context, addr string, timeout time.Duration) (*client.Client, error)

GetSDKClient returns a NeoFS SDK client configured with the specified address and context. If timeout is 0, the default timeout will be used.

func GetWithClient added in v0.107.0

func GetWithClient(ctx context.Context, c Client, priv *keys.PrivateKey, u *url.URL, wrapClientCloser bool) (io.ReadCloser, error)

GetWithClient returns a neofs object from the provided url using the provided client. URI scheme is "neofs:<Container-ID>/<Object-ID/<Command>/<Params>". If Command is not provided, full object is requested. If wrapClientCloser is true, the client will be closed when the returned ReadCloser is closed.

func ObjectSearch added in v0.107.0

func ObjectSearch(ctx context.Context, c Client, priv *keys.PrivateKey, containerIDStr string, prm client.PrmObjectSearch) ([]oid.ID, error)

ObjectSearch returns a list of object IDs from the provided container.

Types

type Client added in v0.107.0

type Client interface {
	ObjectSearchInit(ctx context.Context, containerID cid.ID, s user.Signer, prm client.PrmObjectSearch) (*client.ObjectListReader, error)
	ObjectGetInit(ctx context.Context, container cid.ID, id oid.ID, s user.Signer, get client.PrmObjectGet) (object.Object, *client.PayloadReader, error)
	ObjectRangeInit(ctx context.Context, container cid.ID, id oid.ID, offset uint64, length uint64, s user.Signer, objectRange client.PrmObjectRange) (*client.ObjectRangeReader, error)
	ObjectHead(ctx context.Context, containerID cid.ID, objectID oid.ID, signer user.Signer, prm client.PrmObjectHead) (*object.Object, error)
	ObjectHash(ctx context.Context, containerID cid.ID, objectID oid.ID, signer user.Signer, prm client.PrmObjectHash) ([][]byte, error)
	Close() error
}

Client is a NeoFS client interface.

Jump to

Keyboard shortcuts

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