client

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClientConn

func NewClientConn(host string, certPEMBlock, keyPEMBlock []byte) (*grpc.ClientConn, error)

NewClientConn creates a new gRPC client connected to host. tlsKey and tlsCert must be either both empty or non-empty.

Types

type InMemoryClient

type InMemoryClient struct {
	// contains filtered or unexported fields
}

func NewInMemoryClient

func NewInMemoryClient() *InMemoryClient

func (*InMemoryClient) CheckCapabilities

func (c *InMemoryClient) CheckCapabilities(context.Context) error

func (*InMemoryClient) DownloadFile

func (c *InMemoryClient) DownloadFile(ctx context.Context, key string, w io.Writer) (Metadata, error)

func (*InMemoryClient) FindFile

func (c *InMemoryClient) FindFile(ctx context.Context, key string) (bool, error)

func (*InMemoryClient) UploadFile

func (c *InMemoryClient) UploadFile(ctx context.Context, key, filePath string, metadata Metadata) error

type Interface

type Interface interface {
	CheckCapabilities(ctx context.Context) error
	UploadFile(ctx context.Context, key, filePath string, metadata Metadata) error
	FindFile(ctx context.Context, key string) (bool, error)
	DownloadFile(ctx context.Context, key string, w io.Writer) (Metadata, error)
}

Interface is the remote cache client interface.

func NewClient

func NewClient(cc *grpc.ClientConn) Interface

NewClient instantiates a client for a remote cache.

type Metadata

type Metadata = map[string]any

Metadata contains additional keys-values stored with the uploaded file.

Jump to

Keyboard shortcuts

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