client

package
v1.0.14 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2020 License: MIT Imports: 10 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 provides the client api.

func NewClient

func NewClient(target string, opts ...grpc.DialOption) (*Client, error)

NewClient starts the client.

func (*Client) Archive added in v1.0.4

func (c *Client) Archive(ctx context.Context, key string) (*pb.ArchiveReply, error)

Archive creates a Filecoin bucket archive via Powergate.

func (*Client) ArchiveInfo added in v1.0.4

func (c *Client) ArchiveInfo(ctx context.Context, key string) (*pb.ArchiveInfoReply, error)

ArchiveInfo returns info about a Filecoin bucket archive.

func (*Client) ArchiveStatus added in v1.0.4

func (c *Client) ArchiveStatus(ctx context.Context, key string) (*pb.ArchiveStatusReply, error)

ArchiveStatus returns the status of a Filecoin bucket archive.

func (*Client) ArchiveWatch added in v1.0.4

func (c *Client) ArchiveWatch(ctx context.Context, key string, ch chan<- string) error

ArchiveWatch watches status events from a Filecoin bucket archive.

func (*Client) Close

func (c *Client) Close() error

Close closes the client's grpc connection and cancels any active requests.

func (*Client) Init

func (c *Client) Init(ctx context.Context, opts ...InitOption) (*pb.InitReply, error)

Init initializes a new bucket. The bucket name is only meant to help identify a bucket in a UI and is not unique.

func (c *Client) Links(ctx context.Context, key string) (*pb.LinksReply, error)

Links returns a list of links that can be used to view the bucket.

func (*Client) List

func (c *Client) List(ctx context.Context) (*pb.ListReply, error)

List returns a list of all bucket roots.

func (*Client) ListIpfsPath added in v1.0.8

func (c *Client) ListIpfsPath(ctx context.Context, pth path.Path) (*pb.ListIpfsPathReply, error)

ListIpfsPath returns items at a particular path in a UnixFS path living in the IPFS network.

func (*Client) ListPath

func (c *Client) ListPath(ctx context.Context, key, pth string) (*pb.ListPathReply, error)

ListPath returns information about a bucket path.

func (*Client) PullIpfsPath added in v1.0.8

func (c *Client) PullIpfsPath(ctx context.Context, pth path.Path, writer io.Writer, opts ...Option) error

PullIpfsPath pulls the path from a remote UnixFS dag, writing it to writer if it's a file.

func (*Client) PullPath

func (c *Client) PullPath(ctx context.Context, key, pth string, writer io.Writer, opts ...Option) error

PullPath pulls the bucket path, writing it to writer if it's a file.

func (*Client) PushPath

func (c *Client) PushPath(ctx context.Context, key, pth string, reader io.Reader, opts ...Option) (result path.Resolved, root path.Resolved, err error)

PushPath pushes a file to a bucket path. This will return the resolved path and the bucket's new root path.

func (*Client) Remove

func (c *Client) Remove(ctx context.Context, key string) error

Remove removes an entire bucket. Files and directories will be unpinned.

func (*Client) RemovePath

func (c *Client) RemovePath(ctx context.Context, key, pth string, opts ...Option) (path.Resolved, error)

RemovePath removes the file or directory at path. Files and directories will be unpinned.

func (*Client) Root added in v1.0.7

func (c *Client) Root(ctx context.Context, key string) (*pb.RootReply, error)

Root returns the bucket root.

func (*Client) SetPath added in v1.0.8

func (c *Client) SetPath(ctx context.Context, key, pth string, remoteCid cid.Cid) (*pb.SetPathReply, error)

SetPath set a particular path to an existing IPFS UnixFS DAG.

type InitOption added in v1.0.8

type InitOption func(*initOptions)

func WithCid added in v1.0.8

func WithCid(c cid.Cid) InitOption

WithCid indicates that an inited bucket should be boostraped with a particular UnixFS DAG.

func WithName added in v1.0.9

func WithName(name string) InitOption

WithName sets a name for the bucket.

func WithPrivate added in v1.0.9

func WithPrivate(private bool) InitOption

WithPrivate specifies that an encryption key will be used for the bucket.

type Option

type Option func(*options)

func WithFastForwardOnly added in v1.0.4

func WithFastForwardOnly(root path.Resolved) Option

WithFastForwardOnly instructs the remote to reject non-fast-forward updates by comparing root with the remote.

func WithProgress

func WithProgress(ch chan<- int64) Option

WithProgress writes progress updates to the given channel.

Jump to

Keyboard shortcuts

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