Documentation
¶
Overview ¶
Package icpaybucket is a client for the ICPay Bucket canister.
Index ¶
- Constants
- func PublicFileURL(canisterID, bucketName, path string) string
- type ApiKeyPermissions
- type ApiResult
- type Client
- func (c *Client) BeginFileUpload(bucketID, path, contentType string, totalSize uint64, apiKey string) (resultFileID, error)
- func (c *Client) BulkCopyFiles(bucketID string, ops []FilePathOp, apiKey string) (resultNat, error)
- func (c *Client) BulkDeleteFiles(bucketID string, paths []string, apiKey string) (resultNat, error)
- func (c *Client) BulkMoveFiles(bucketID string, ops []FilePathOp, apiKey string) (resultNat, error)
- func (c *Client) CompleteFileUpload(uploadID, apiKey string) (resultFileID, error)
- func (c *Client) CopyFile(bucketID, source, destination, apiKey string) (resultFilePublic, error)
- func (c *Client) DeleteFile(bucketID, path, apiKey string) (resultUnit, error)
- func (c *Client) DownloadFile(bucketID, path, apiKey string) (resultBlob, error)
- func (c *Client) FileExists(bucketID, path, apiKey string) (resultBool, error)
- func (c *Client) GetBucketCycleStatus() (..., error)
- func (c *Client) GetFile(bucketID, path, apiKey string) (resultFilePublic, error)
- func (c *Client) GetFileMetadata(bucketID, path, apiKey string) (resultString, error)
- func (c *Client) GetPublicFileURL(bucketID, path string) (resultString, error)
- func (c *Client) ListFiles(bucketID string, page, pageSize uint64, apiKey string) (resultFileList, error)
- func (c *Client) ListFolder(bucketID, prefix string, page, pageSize uint64, apiKey string) (resultFileList, error)
- func (c *Client) MoveFile(bucketID, source, destination, apiKey string) (resultFilePublic, error)
- func (c *Client) PublicURL(bucketName, path string) string
- func (c *Client) SearchFiles(bucketID, query string, page, pageSize uint64, apiKey string) (resultFileList, error)
- func (c *Client) SetFileMetadata(bucketID, path, metadata, apiKey string) (resultFilePublic, error)
- func (c *Client) SetFileTags(bucketID, path string, tags []string, apiKey string) (resultFilePublic, error)
- func (c *Client) UploadFile(bucketID, path string, data []byte, contentType, apiKey string) (resultFileID, error)
- func (c *Client) UploadFileChunkIndexed(uploadID string, chunkIndex uint64, data []byte) (resultNat, error)
- type ClientOptions
- type FileListPage
- type FilePathOp
- type FilePublic
Constants ¶
View Source
const DefaultCanisterID = "6vbhm-nqaaa-aaaan-q6muq-cai"
View Source
const SingleMaxBytes = 1_850_000
Variables ¶
This section is empty.
Functions ¶
func PublicFileURL ¶
PublicFileURL builds the raw HTTP gateway URL for a public file. No canister call is involved — this is the URL served directly by the gateway.
Types ¶
type ApiKeyPermissions ¶ added in v1.1.0
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(options ClientOptions) (*Client, error)
func (*Client) BeginFileUpload ¶ added in v1.1.0
func (*Client) BulkCopyFiles ¶ added in v1.1.0
func (c *Client) BulkCopyFiles(bucketID string, ops []FilePathOp, apiKey string) (resultNat, error)
func (*Client) BulkDeleteFiles ¶ added in v1.1.0
func (*Client) BulkMoveFiles ¶ added in v1.1.0
func (c *Client) BulkMoveFiles(bucketID string, ops []FilePathOp, apiKey string) (resultNat, error)
func (*Client) CompleteFileUpload ¶ added in v1.1.0
func (*Client) DeleteFile ¶
func (*Client) DownloadFile ¶
func (*Client) FileExists ¶ added in v1.1.0
func (*Client) GetBucketCycleStatus ¶ added in v1.1.0
func (*Client) GetFileMetadata ¶ added in v1.1.0
func (*Client) GetPublicFileURL ¶
func (*Client) ListFolder ¶ added in v1.1.0
func (*Client) SearchFiles ¶ added in v1.1.0
func (*Client) SetFileMetadata ¶ added in v1.1.0
func (*Client) SetFileTags ¶ added in v1.1.0
func (*Client) UploadFile ¶
type ClientOptions ¶
type FileListPage ¶
type FilePathOp ¶ added in v1.1.0
type FilePublic ¶
type FilePublic struct {
ID string `ic:"id"`
Path string `ic:"path"`
Name string `ic:"name"`
Size idl.Nat `ic:"size"`
ContentType string `ic:"contentType"`
CreatedAt idl.Int `ic:"createdAt"`
UpdatedAt *idl.Int `ic:"updatedAt"`
Metadata *string `ic:"metadata"`
Tags []string `ic:"tags"`
PublicURL *string `ic:"publicUrl"`
}
Click to show internal directories.
Click to hide internal directories.