client

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package client implements an object store service client

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidConfig = errors.New("invalid configuration")

ErrInvalidConfig signals an error with the client configuration

Functions

This section is empty.

Types

type StoreClient

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

StoreClient access blobs in a StoreServer

func NewStoreClient

func NewStoreClient(config StoreClientConfig) (*StoreClient, error)

NewStoreClient returns a client for an object store server

func (*StoreClient) Download

func (c *StoreClient) Download(_ context.Context, object store.Object) (io.ReadCloser, error)

Download returns the content of the object given its url

func (*StoreClient) Get

func (c *StoreClient) Get(_ context.Context, id string) (store.Object, error)

Get retrieves an objects if exists in the store or an error otherwise

func (*StoreClient) Put

func (c *StoreClient) Put(_ context.Context, id string, content io.Reader) (store.Object, error)

Put stores the object and returns the metadata

type StoreClientConfig

type StoreClientConfig struct {
	Server string
}

StoreClientConfig defines the configuration for accessing a remote object store service

Jump to

Keyboard shortcuts

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