Versions in this module Expand all Collapse all v0 v0.2.0 Jun 13, 2026 v0.1.0 Jun 12, 2026 Changes in this version + const DefaultResumablePartSize + const DefaultURLExpiresIn + var ProviderNames = []string + var Providers = map[string]Provider + func IsCode(err error, code ErrorCode) bool + type ActionEvent struct + Duration time.Duration + Error *Error + From string + Key string + Keys []string + Result any + Status string + To string + Type ActionType + type ActionType string + const ActionCopy + const ActionDelete + const ActionDownload + const ActionExists + const ActionHead + const ActionList + const ActionMove + const ActionSignedUploadURL + const ActionURL + const ActionUpload + type Adapter interface + Capabilities func() AdapterCapabilities + Copy func(context.Context, string, string, OperationOptions) error + Delete func(context.Context, string, OperationOptions) error + Download func(context.Context, string, DownloadOptions) (StoredFile, error) + Exists func(context.Context, string, OperationOptions) (bool, error) + Head func(context.Context, string, OperationOptions) (StoredFile, error) + List func(context.Context, ListOptions) (ListResult, error) + Name func() string + Raw func() any + SignedUploadURL func(context.Context, string, SignedUploadOptions) (SignedUpload, error) + URL func(context.Context, string, URLOptions) (string, error) + Upload func(context.Context, string, Body, UploadOptions) (UploadResult, error) + type AdapterCapabilities struct + CacheControl bool + Delimiter bool + Metadata bool + Multipart bool + RangeRead bool + Resumable bool + ServerSideCopy bool + SignedURL SignedURLCapability + UploadProgress bool + type Body struct + func BodyWithProgress(body Body, report func(UploadProgress)) Body + func BytesBody(data []byte) Body + func FileBody(path string) Body + func NewBodyFromReadCloser(open func(context.Context) (io.ReadCloser, error), size int64, sizeKnown bool, ...) Body + func ReaderBody(reader io.Reader) Body + func StringBody(value string) Body + func (b Body) ContentType() string + func (b Body) Open(ctx context.Context) (io.ReadCloser, error) + func (b Body) ReadAll(ctx context.Context) ([]byte, error) + func (b Body) Replayable() bool + func (b Body) Size() (int64, bool) + type BulkError struct + Error *Error + Key string + type BulkOptions struct + Concurrency int + StopOnError bool + type ByteRange struct + End *int64 + Start int64 + type Client struct + func MustNew(opts Options) *Client + func New(opts Options) (*Client, error) + func (c *Client) Adapter() Adapter + func (c *Client) Capabilities() AdapterCapabilities + func (c *Client) Copy(ctx context.Context, from string, to string, opts OperationOptions) error + func (c *Client) Delete(ctx context.Context, key string, opts OperationOptions) error + func (c *Client) DeleteMany(ctx context.Context, keys []string, opts DeleteManyOptions) (DeleteManyResult, error) + func (c *Client) Download(ctx context.Context, key string, opts DownloadOptions) (StoredFile, error) + func (c *Client) DownloadMany(ctx context.Context, keys []string, opts DownloadManyOptions) (DownloadManyResult, error) + func (c *Client) Exists(ctx context.Context, key string, opts OperationOptions) (bool, error) + func (c *Client) ExistsMany(ctx context.Context, keys []string, opts BulkOptions) (ExistsManyResult, error) + func (c *Client) File(key string) FileHandle + func (c *Client) Head(ctx context.Context, key string, opts OperationOptions) (StoredFile, error) + func (c *Client) HeadMany(ctx context.Context, keys []string, opts BulkOptions) (HeadManyResult, error) + func (c *Client) List(ctx context.Context, opts ListOptions) (ListResult, error) + func (c *Client) ListAll(ctx context.Context, opts ListOptions, yield func(StoredFile) error) error + func (c *Client) Move(ctx context.Context, from string, to string, opts OperationOptions) error + func (c *Client) Prefix() string + func (c *Client) Raw() any + func (c *Client) ReadOnly() *Client + func (c *Client) Search(ctx context.Context, pattern string, opts SearchOptions, ...) error + func (c *Client) SignedUploadURL(ctx context.Context, key string, opts SignedUploadOptions) (SignedUpload, error) + func (c *Client) URL(ctx context.Context, key string, opts URLOptions) (string, error) + func (c *Client) Upload(ctx context.Context, key string, body Body, opts UploadOptions) (UploadResult, error) + func (c *Client) UploadMany(ctx context.Context, items []UploadManyItem, opts UploadManyOptions) (UploadManyResult, error) + type DeleteManyAdapter interface + DeleteMany func(context.Context, []string, DeleteManyOptions) (DeleteManyResult, error) + type DeleteManyError struct + Error *Error + Key string + type DeleteManyOptions struct + Concurrency int + StopOnError bool + type DeleteManyResult struct + Deleted []string + Errors []DeleteManyError + type DownloadManyOptions struct + Range *ByteRange + type DownloadManyResult struct + Downloaded []StoredFile + Errors []BulkError + type DownloadOptions struct + Range *ByteRange + type EnvGroup struct + Label string + Vars []EnvVar + type EnvVar struct + Aliases []string + Description string + Key string + ReadBy string + Secret bool + func GetSecretEnvVars(slug string) []EnvVar + func ListEnvVars(slug string) []EnvVar + type Error struct + Aborted bool + Cause error + Code ErrorCode + Message string + Permanent bool + TimedOut bool + func NewError(code ErrorCode, message string, cause error) *Error + func NewPermanentError(code ErrorCode, message string, cause error) *Error + func TimeoutError(timeoutLabel string) *Error + func WrapError(err error, fallback ErrorCode) *Error + func (e *Error) Error() string + func (e *Error) Unwrap() error + type ErrorCode string + const ErrConflict + const ErrNotFound + const ErrProvider + const ErrReadOnly + const ErrUnauthorized + type ErrorEvent struct + Duration time.Duration + Error *Error + From string + Key string + Keys []string + To string + Type ActionType + type ExistsManyResult struct + Errors []BulkError + Existing []string + Missing []string + type FileHandle struct + func (f FileHandle) CopyFrom(ctx context.Context, source string, opts OperationOptions) error + func (f FileHandle) CopyTo(ctx context.Context, destination string, opts OperationOptions) error + func (f FileHandle) Delete(ctx context.Context, opts OperationOptions) error + func (f FileHandle) Download(ctx context.Context, opts DownloadOptions) (StoredFile, error) + func (f FileHandle) Exists(ctx context.Context, opts OperationOptions) (bool, error) + func (f FileHandle) Head(ctx context.Context, opts OperationOptions) (StoredFile, error) + func (f FileHandle) Key() string + func (f FileHandle) MoveFrom(ctx context.Context, source string, opts OperationOptions) error + func (f FileHandle) MoveTo(ctx context.Context, destination string, opts OperationOptions) error + func (f FileHandle) SignedUploadURL(ctx context.Context, opts SignedUploadOptions) (SignedUpload, error) + func (f FileHandle) URL(ctx context.Context, opts URLOptions) (string, error) + func (f FileHandle) Upload(ctx context.Context, body Body, opts UploadOptions) (UploadResult, error) + type Handler func(context.Context, Operation) (any, error) + type HeadManyResult struct + Errors []BulkError + Files []StoredFile + type Hooks struct + OnAction func(ActionEvent) + OnError func(ErrorEvent) + OnRetry func(RetryEvent) + type ListOptions struct + Cursor string + Delimiter string + Limit int32 + Prefix string + type ListResult struct + Cursor string + Items []StoredFile + Prefixes []string + type Middleware func(context.Context, Operation, Handler) (any, error) + func Handlers(handlers map[OperationKind]Middleware) Middleware + type MoveAdapter interface + Move func(context.Context, string, string, OperationOptions) error + type MultipartOptions struct + Concurrency int + PartSize int64 + type Operation struct + Body Body + Bulk bool + DownloadOptions DownloadOptions + From string + Key string + Keys []string + Kind OperationKind + ListOptions ListOptions + OperationOptions OperationOptions + SignedUploadOptions SignedUploadOptions + To string + URLOptions URLOptions + UploadOptions UploadOptions + type OperationKind string + const OperationCopy + const OperationDelete + const OperationDownload + const OperationExists + const OperationHead + const OperationList + const OperationMove + const OperationSignedUploadURL + const OperationURL + const OperationUpload + type OperationOptions struct + Retries *RetryOptions + Timeout time.Duration + type Options struct + Adapter Adapter + Hooks Hooks + Middleware []Middleware + Prefix string + ReadOnly bool + Retries *RetryOptions + Timeout time.Duration + type PartMeta struct + ETag string + PartNumber int + Size int64 + type Provider struct + Description string + Env ProviderEnvSpec + Name string + PeerDeps []string + Slug string + func GetProvider(slug string) (Provider, bool) + type ProviderEnvSpec struct + Config []string + CredentialModes []EnvGroup + Notes string + Optional []EnvVar + Required []EnvVar + type ResumableAdapter interface + ResumableUpload func(context.Context, string, ResumableUploadOptions) (ResumableDriver, error) + type ResumableDriver interface + Abort func(context.Context) error + Adopt func(context.Context, ResumableSession) error + Begin func(context.Context, ResumableUploadMeta) (ResumableSession, error) + Complete func(context.Context, []PartMeta) (UploadResult, error) + Probe func(context.Context) (ResumableProbe, error) + UploadPart func(context.Context, ResumablePart) (PartMeta, error) + type ResumablePart struct + Data []byte + Offset int64 + PartNumber int + type ResumableProbe struct + NextOffset int64 + Parts []PartMeta + type ResumableSession struct + Bucket string + ContentType string + Key string + PartSize int64 + Parts []PartMeta + Provider string + TempPath string + UploadID string + type ResumableUploadMeta struct + CacheControl string + ContentType string + Key string + Metadata map[string]string + PartSize int64 + Size int64 + type ResumableUploadOptions struct + CacheControl string + ContentType string + Metadata map[string]string + Multipart *MultipartOptions + type RetryBackoffContext struct + Attempt int + Error *Error + type RetryEvent struct + Attempt int + Delay time.Duration + Error *Error + From string + Key string + MaxRetries int + To string + Type ActionType + type RetryOptions struct + Backoff func(RetryBackoffContext) time.Duration + Max int + type SearchMatch string + const SearchExact + const SearchGlob + const SearchRegex + const SearchSubstring + type SearchOptions struct + CaseInsensitive bool + Limit int32 + Match SearchMatch + MaxResults int + Prefix string + type SignedURLCapability struct + MaxExpiresIn time.Duration + Supported bool + type SignedUpload struct + Fields map[string]string + Headers map[string]string + Method string + URL string + type SignedUploadOptions struct + ContentType string + ExpiresIn time.Duration + MaxSize *int64 + MinSize *int64 + type StoredFile struct + ContentType string + ETag string + Key string + LastModified time.Time + Metadata map[string]string + Name string + Size int64 + func NewStoredFile(meta StoredFileMeta, open func(context.Context) (io.ReadCloser, error)) StoredFile + func NewStoredFileFromBytes(meta StoredFileMeta, data []byte) StoredFile + func (f StoredFile) Bytes(ctx context.Context) ([]byte, error) + func (f StoredFile) Open(ctx context.Context) (io.ReadCloser, error) + func (f StoredFile) Text(ctx context.Context) (string, error) + type StoredFileMeta struct + ContentType string + ETag string + Key string + LastModified time.Time + Metadata map[string]string + Size int64 + type TransferOptions struct + Limit int32 + OnProgress func(TransferProgress) + Overwrite *bool + Prefix string + TransformKey func(string) string + type TransferProgress struct + Done int + Key string + Status string + Total int + type TransferResult struct + Errors []BulkError + Skipped []string + Transferred []string + func Transfer(ctx context.Context, source *Client, dest *Client, opts TransferOptions) (TransferResult, error) + type URLOptions struct + ExpiresIn time.Duration + ResponseContentDisposition string + type UploadControl struct + func NewUploadControl() *UploadControl + func UploadControlFrom(session ResumableSession) *UploadControl + func (c *UploadControl) Abort(ctx context.Context) error + func (c *UploadControl) Loaded() int64 + func (c *UploadControl) Pause() + func (c *UploadControl) Resume() + func (c *UploadControl) Session() (ResumableSession, bool) + func (c *UploadControl) Status() UploadControlStatus + func (c *UploadControl) Total() int64 + type UploadControlStatus string + const UploadControlAborted + const UploadControlCompleted + const UploadControlError + const UploadControlIdle + const UploadControlPaused + const UploadControlUploading + type UploadManyItem struct + Body Body + CacheControl string + ContentType string + Key string + Metadata map[string]string + Multipart *MultipartOptions + type UploadManyOptions struct + OnProgress func(string, UploadProgress) + type UploadManyResult struct + Errors []BulkError + Uploaded []UploadResult + type UploadOptions struct + CacheControl string + ContentType string + Control *UploadControl + Metadata map[string]string + Multipart *MultipartOptions + OnProgress func(UploadProgress) + type UploadProgress struct + Known bool + Loaded int64 + Total int64 + type UploadResult struct + ContentType string + ETag string + Key string + LastModified time.Time + Size int64