client

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2026 License: MIT Imports: 17 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 meant to be used to access to a remote node

func New

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

New returns a client to connect to a remote Storing service

func (*Client) CheckReplica added in v0.5.0

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

CheckReplica fetches the VolumeIDs and replica count for a file from a remote node.

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, ttl time.Duration, ca time.Time) 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, ttl time.Duration, ca time.Time) (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, int64, 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 on this specific node (local check only).

func (*Client) StatFile added in v0.5.0

func (cl *Client) StatFile(ctx context.Context, key string) (*volume.FileStat, error)

StatFile returns metadata for the file by issuing a HEAD request to the remote node.

func (*Client) UpdateFileReplica

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

UpdateFileReplica updates the file replica information

Jump to

Keyboard shortcuts

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