client

package
v0.2103.13 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2022 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Package client implements a client for Oasis storage nodes. The client connects to nodes as directed by the node watcher.

Index

Constants

View Source
const BackendName = "client"

BackendName is the name of this implementation.

Variables

View Source
var ErrStorageNotAvailable = errors.New("storage/client: storage not available")

ErrStorageNotAvailable is the error returned when no storage node is available.

Functions

func NewForNodes added in v0.2012.3

func NewForNodes(
	ctx context.Context,
	ident *identity.Identity,
	nodes nodes.NodeDescriptorLookup,
	runtime registry.RuntimeDescriptorProvider,
	opts ...Option,
) (api.Backend, error)

NewForNodes creates a new storage client that connects to nodes watched by the provided nodes lookup.

func NewForNodesClient added in v0.2012.3

func NewForNodesClient(
	ctx context.Context,
	client grpc.NodesClient,
	runtime registry.RuntimeDescriptorProvider,
	opts ...Option,
) (api.Backend, error)

NewForNodesClient creates a new storage client that connects to nodes watched by the provided nodes gRPC client.

func NewForPublicStorage added in v0.2100.0

func NewForPublicStorage(
	ctx context.Context,
	namespace common.Namespace,
	ident *identity.Identity,
	consensus consensus.Backend,
	runtime registry.RuntimeDescriptorProvider,
	opts ...Option,
) (api.Backend, error)

NewForPublicStorage creates a new storage client that automatically follows a given runtime's storage nodes which have public storage RPC enabled.

func NewStatic

func NewStatic(
	ctx context.Context,
	ident *identity.Identity,
	consensus consensus.Backend,
	nodeID signature.PublicKey,
	opts ...Option,
) (api.Backend, error)

NewStatic creates a new storage client that only follows a specific storage node.

This is mostly useful for tests.

Types

type Option added in v0.2102.4

type Option func(b *storageClientBackend)

Option is a storage client option.

func WithBackendOverride added in v0.2102.4

func WithBackendOverride(nodeID signature.PublicKey, backend api.Backend) Option

WithBackendOverride overrides the storage backend for the specified node. The passed backend is used instead of the gRPC backend when performing storage requests.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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