Documentation ¶
Index ¶
- type ArchiveOption
- type Client
- func (c *Client) Archive(ctx context.Context, key string, opts ...ArchiveOption) error
- func (c *Client) ArchiveInfo(ctx context.Context, key string) (*pb.ArchiveInfoResponse, error)
- func (c *Client) ArchiveStatus(ctx context.Context, key string) (*pb.ArchiveStatusResponse, error)
- func (c *Client) ArchiveWatch(ctx context.Context, key string, ch chan<- string) error
- func (c *Client) Close() error
- func (c *Client) Create(ctx context.Context, opts ...CreateOption) (*pb.CreateResponse, error)
- func (c *Client) DefaultArchiveConfig(ctx context.Context, key string) (*pb.ArchiveConfig, error)
- func (c *Client) Links(ctx context.Context, key, pth string) (*pb.LinksResponse, error)
- func (c *Client) List(ctx context.Context) (*pb.ListResponse, error)
- func (c *Client) ListIpfsPath(ctx context.Context, pth path.Path) (*pb.ListIpfsPathResponse, error)
- func (c *Client) ListPath(ctx context.Context, key, pth string) (*pb.ListPathResponse, error)
- func (c *Client) PullIpfsPath(ctx context.Context, pth path.Path, writer io.Writer, opts ...Option) error
- func (c *Client) PullPath(ctx context.Context, key, pth string, writer io.Writer, opts ...Option) error
- func (c *Client) PullPathAccessRoles(ctx context.Context, key, pth string) (map[string]buckets.Role, error)
- func (c *Client) PushPath(ctx context.Context, key, pth string, reader io.Reader, opts ...Option) (result path.Resolved, root path.Resolved, err error)
- func (c *Client) PushPathAccessRoles(ctx context.Context, key, pth string, roles map[string]buckets.Role) error
- func (c *Client) Remove(ctx context.Context, key string) error
- func (c *Client) RemovePath(ctx context.Context, key, pth string, opts ...Option) (path.Resolved, error)
- func (c *Client) Root(ctx context.Context, key string) (*pb.RootResponse, error)
- func (c *Client) SetDefaultArchiveConfig(ctx context.Context, key string, config *pb.ArchiveConfig) error
- func (c *Client) SetPath(ctx context.Context, key, pth string, remoteCid cid.Cid) (*pb.SetPathResponse, error)
- type CreateOption
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArchiveOption ¶
type ArchiveOption func(*pb.ArchiveRequest)
func WithArchiveConfig ¶
func WithArchiveConfig(config *pb.ArchiveConfig) ArchiveOption
WithArchiveConfig allows you to provide a custom ArchiveConfig for a single call to Archive.
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) ArchiveInfo ¶
ArchiveInfo returns info about a Filecoin bucket archive.
func (*Client) ArchiveStatus ¶
ArchiveStatus returns the status of a Filecoin bucket archive.
func (*Client) ArchiveWatch ¶
ArchiveWatch watches status events from a Filecoin bucket archive.
func (*Client) Create ¶
func (c *Client) Create(ctx context.Context, opts ...CreateOption) (*pb.CreateResponse, error)
Create initializes a new bucket. The bucket name is only meant to help identify a bucket in a UI and is not unique.
func (*Client) DefaultArchiveConfig ¶
DefaultArchiveConfig gets the default archive config for the specified Bucket.
func (*Client) ListIpfsPath ¶
ListIpfsPath returns items at a particular path in a UnixFS path living in the IPFS network.
func (*Client) PullIpfsPath ¶
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) PullPathAccessRoles ¶
func (c *Client) PullPathAccessRoles(ctx context.Context, key, pth string) (map[string]buckets.Role, error)
PullPathAccessRoles returns access roles for a path.
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) PushPathAccessRoles ¶
func (c *Client) PushPathAccessRoles(ctx context.Context, key, pth string, roles map[string]buckets.Role) error
PushPathAccessRoles updates path access roles by merging the pushed roles with existing roles. roles is a map of string marshaled public keys to path roles. A non-nil error is returned if the map keys are not unmarshalable to public keys. To delete a role for a public key, set its value to buckets.None.
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) SetDefaultArchiveConfig ¶
func (c *Client) SetDefaultArchiveConfig(ctx context.Context, key string, config *pb.ArchiveConfig) error
SetDefaultArchiveConfig sets the default archive config for the specified Bucket.
type CreateOption ¶
type CreateOption func(*createOptions)
func WithCid ¶
func WithCid(c cid.Cid) CreateOption
WithCid indicates that an inited bucket should be boostraped with a particular UnixFS DAG.
func WithPrivate ¶
func WithPrivate(private bool) CreateOption
WithPrivate specifies that an encryption key will be used for the bucket.
type Option ¶
type Option func(*options)
func WithFastForwardOnly ¶
WithFastForwardOnly instructs the remote to reject non-fast-forward updates by comparing root with the remote.
func WithProgress ¶
WithProgress writes progress updates to the given channel.