Documentation
¶
Overview ¶
Package storeclient implements the client side of croc-store-v1 for the CLI.
Index ¶
- func IsStoredValue(value string) bool
- type Callbacks
- type Client
- func (c *Client) Inspect(ctx context.Context, share storecrypto.Share) (storecrypto.Manifest, time.Time, error)
- func (c *Client) Receive(ctx context.Context, share storecrypto.Share, manifest storecrypto.Manifest, ...) error
- func (c *Client) Revoke(ctx context.Context, share storecrypto.Share, uploadToken string) error
- func (c *Client) Upload(ctx context.Context, origin string, paths []string, callbacks Callbacks) (result UploadResult, err error)
- func (c *Client) UploadWithDownloads(ctx context.Context, origin string, paths []string, downloads int, ...) (result UploadResult, err error)
- func (c *Client) UploadWithOptions(ctx context.Context, origin string, paths []string, options UploadOptions, ...) (result UploadResult, err error)
- type HTTPError
- type Progress
- type UploadOptions
- type UploadResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsStoredValue ¶
IsStoredValue reports whether input looks like a stored URL or CLI token.
Types ¶
type Client ¶
Client talks to one croc stored-transfer HTTP service. It must not be copied after first use.
func (*Client) Inspect ¶
func (c *Client) Inspect(ctx context.Context, share storecrypto.Share) (storecrypto.Manifest, time.Time, error)
Inspect fetches and decrypts a manifest without claiming the transfer.
func (*Client) Receive ¶
func (c *Client) Receive( ctx context.Context, share storecrypto.Share, manifest storecrypto.Manifest, outputDirectory string, callbacks Callbacks, ) error
Receive claims, downloads, verifies, and atomically installs all files.
func (*Client) Revoke ¶
Revoke deletes an incomplete or available transfer using the sender receipt.
func (*Client) Upload ¶
func (c *Client) Upload( ctx context.Context, origin string, paths []string, callbacks Callbacks, ) (result UploadResult, err error)
Upload hashes, encrypts, and uploads regular files. Upload sessions are not persisted; a terminal failure revokes the partial transfer.
func (*Client) UploadWithDownloads ¶
func (c *Client) UploadWithDownloads( ctx context.Context, origin string, paths []string, downloads int, callbacks Callbacks, ) (result UploadResult, err error)
UploadWithDownloads uploads regular files with a requested verified-download allowance. Servers reject values above their configured maximum.
func (*Client) UploadWithOptions ¶
func (c *Client) UploadWithOptions( ctx context.Context, origin string, paths []string, options UploadOptions, callbacks Callbacks, ) (result UploadResult, err error)
UploadWithOptions uploads regular files with a requested verified-download allowance and finite storage lifetime.
type Progress ¶
type Progress struct {
FileIndex int
FileCount int
FileName string
FileBytes int64
FileSize int64
TotalBytes int64
TotalSize int64
}
Progress reports plaintext bytes processed.
type UploadOptions ¶
UploadOptions configures a stored upload. Zero values select the historical defaults of one verified download and one day of storage.