Documentation ¶
Index ¶
- type Client
- func (c *Client) Account(ctx context.Context, hostKey types.PublicKey) (account rhpv3.Account, err error)
- func (c *Client) Accounts(ctx context.Context) (accounts []api.Account, err error)
- func (c *Client) Contracts(ctx context.Context, hostTimeout time.Duration) (resp api.ContractsResponse, err error)
- func (c *Client) DeleteObject(ctx context.Context, bucket, path string, opts api.DeleteObjectOptions) (err error)
- func (c *Client) DownloadObject(ctx context.Context, w io.Writer, bucket, path string, ...) (err error)
- func (c *Client) DownloadStats() (resp api.DownloadStatsResponse, err error)
- func (c *Client) GetObject(ctx context.Context, bucket, path string, opts api.DownloadObjectOptions) (*api.GetObjectResponse, error)
- func (c *Client) HeadObject(ctx context.Context, bucket, path string, opts api.HeadObjectOptions) (*api.HeadObjectResponse, error)
- func (c *Client) ID(ctx context.Context) (id string, err error)
- func (c *Client) Memory(ctx context.Context) (resp api.MemoryResponse, err error)
- func (c *Client) MigrateSlab(ctx context.Context, slab object.Slab, set string) (res api.MigrateSlabResponse, err error)
- func (c *Client) NotifyEvent(ctx context.Context, e webhooks.Event) (err error)
- func (c *Client) ObjectEntries(ctx context.Context, bucket, path string, opts api.GetObjectOptions) (entries []api.ObjectMetadata, err error)
- func (c *Client) RHPPriceTable(ctx context.Context, hostKey types.PublicKey, siamuxAddr string, ...) (pt api.HostPriceTable, err error)
- func (c *Client) RHPScan(ctx context.Context, hostKey types.PublicKey, hostIP string, ...) (resp api.RHPScanResponse, err error)
- func (c *Client) ResetDrift(ctx context.Context, id rhpv3.Account) (err error)
- func (c *Client) State() (state api.WorkerStateResponse, err error)
- func (c *Client) UploadMultipartUploadPart(ctx context.Context, r io.Reader, bucket, path, uploadID string, ...) (*api.UploadMultipartUploadPartResponse, error)
- func (c *Client) UploadObject(ctx context.Context, r io.Reader, bucket, path string, ...) (*api.UploadObjectResponse, error)
- func (c *Client) UploadStats() (resp api.UploadStatsResponse, err error)
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
}
A Client provides methods for interacting with a worker.
func (*Client) Account ¶
func (c *Client) Account(ctx context.Context, hostKey types.PublicKey) (account rhpv3.Account, err error)
Account returns the account id for a given host.
func (*Client) Contracts ¶
func (c *Client) Contracts(ctx context.Context, hostTimeout time.Duration) (resp api.ContractsResponse, err error)
Contracts returns all contracts from the worker. These contracts decorate a bus contract with the contract's latest revision.
func (*Client) DeleteObject ¶
func (c *Client) DeleteObject(ctx context.Context, bucket, path string, opts api.DeleteObjectOptions) (err error)
DeleteObject deletes the object at the given path.
func (*Client) DownloadObject ¶
func (c *Client) DownloadObject(ctx context.Context, w io.Writer, bucket, path string, opts api.DownloadObjectOptions) (err error)
DownloadObject downloads the object at the given path.
func (*Client) DownloadStats ¶
func (c *Client) DownloadStats() (resp api.DownloadStatsResponse, err error)
DownloadStats returns download statistics.
func (*Client) GetObject ¶
func (c *Client) GetObject(ctx context.Context, bucket, path string, opts api.DownloadObjectOptions) (*api.GetObjectResponse, error)
GetObject returns the object at given path alongside its metadata.
func (*Client) HeadObject ¶ added in v1.0.6
func (c *Client) HeadObject(ctx context.Context, bucket, path string, opts api.HeadObjectOptions) (*api.HeadObjectResponse, error)
HeadObject returns the metadata of the object at the given path.
func (*Client) MigrateSlab ¶
func (c *Client) MigrateSlab(ctx context.Context, slab object.Slab, set string) (res api.MigrateSlabResponse, err error)
MigrateSlab migrates the specified slab.
func (*Client) NotifyEvent ¶ added in v1.1.0
NotifyEvent notifies the worker of an event.
func (*Client) ObjectEntries ¶
func (c *Client) ObjectEntries(ctx context.Context, bucket, path string, opts api.GetObjectOptions) (entries []api.ObjectMetadata, err error)
ObjectEntries returns the entries at the given path, which must end in /.
func (*Client) RHPPriceTable ¶
func (c *Client) RHPPriceTable(ctx context.Context, hostKey types.PublicKey, siamuxAddr string, timeout time.Duration) (pt api.HostPriceTable, err error)
RHPPriceTable fetches a price table for a host.
func (*Client) RHPScan ¶
func (c *Client) RHPScan(ctx context.Context, hostKey types.PublicKey, hostIP string, timeout time.Duration) (resp api.RHPScanResponse, err error)
RHPScan scans a host, returning its current settings.
func (*Client) ResetDrift ¶ added in v1.1.0
ResetDrift resets the drift of an account to zero.
func (*Client) State ¶
func (c *Client) State() (state api.WorkerStateResponse, err error)
State returns the current state of the worker.
func (*Client) UploadMultipartUploadPart ¶
func (c *Client) UploadMultipartUploadPart(ctx context.Context, r io.Reader, bucket, path, uploadID string, partNumber int, opts api.UploadMultipartUploadPartOptions) (*api.UploadMultipartUploadPartResponse, error)
UploadMultipartUploadPart uploads part of the data for a multipart upload.
func (*Client) UploadObject ¶
func (c *Client) UploadObject(ctx context.Context, r io.Reader, bucket, path string, opts api.UploadObjectOptions) (*api.UploadObjectResponse, error)
UploadObject uploads the data in r, creating an object at the given path.
func (*Client) UploadStats ¶
func (c *Client) UploadStats() (resp api.UploadStatsResponse, err error)
UploadStats returns the upload stats.