client

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is the client structure that fulfills the storing.Service interface and it's ment to be used to access to a remote node

func New

func New(hosts ...string) (*Client, error)

New returns an client to connect to a remote Storing service

func (*Client) Config

func (cl *Client) Config(ctx context.Context) (*config.Config, error)

Config returns the config of the Node

func (*Client) CreateFile

func (cl *Client) CreateFile(ctx context.Context, key string, r io.ReadCloser, rep int) error

CreateFile creates a file with the given key and the r content with rep replicas

func (*Client) CreateReplica

func (cl *Client) CreateReplica(ctx context.Context, key string, reader io.ReadCloser) (string, error)

CreateReplica creates a new replica to the Node

func (*Client) DeleteFile

func (cl *Client) DeleteFile(ctx context.Context, key string) error

DeleteFile deletes the file with the given key

func (*Client) GetFile

func (cl *Client) GetFile(ctx context.Context, key string) (io.ReadCloser, error)

GetFile returns the requested file

func (*Client) HasFile

func (cl *Client) HasFile(ctx context.Context, key string) (string, bool, error)

HasFile returns if the file exists

func (*Client) UpdateFileReplica

func (cl *Client) UpdateFileReplica(ctx context.Context, key string, vids []string, replica int) error

UpdateFileReplica updtes the file replica information

Jump to

Keyboard shortcuts

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