Documentation
¶
Overview ¶
Package storage provides the direct-transfer Platform93 object storage flow. It never receives or stores S3 credentials; Platform93 authorizes short-lived transfer URLs for the authenticated application actor.
Index ¶
- type Client
- func (c *Client) CompleteUpload(ctx context.Context, objectID, workspaceID string) (Object, error)
- func (c *Client) CreateUpload(ctx context.Context, input CreateUpload, idempotencyKey, workspaceID string) (UploadAuthorization, error)
- func (c *Client) Delete(ctx context.Context, objectID, workspaceID string) error
- func (c *Client) Download(ctx context.Context, objectID, workspaceID string) (Download, error)
- func (c *Client) List(ctx context.Context, workspaceID string) (Page, error)
- func (c *Client) Put(ctx context.Context, authorization UploadAuthorization, body io.Reader) error
- type CreateUpload
- type Download
- type Object
- type Page
- type UploadAuthorization
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
BaseURL string
ApplicationID string
AccessToken func(context.Context) (string, error)
HTTPClient *http.Client
}
func (*Client) CompleteUpload ¶
func (*Client) CreateUpload ¶
func (c *Client) CreateUpload(ctx context.Context, input CreateUpload, idempotencyKey, workspaceID string) (UploadAuthorization, error)
type CreateUpload ¶
type Object ¶
type Object struct {
ID string `json:"id"`
ApplicationID *string `json:"application_id"`
ProviderID string `json:"provider_id"`
OwnerType string `json:"owner_type"`
OwnerID *string `json:"owner_id"`
Visibility string `json:"visibility"`
Filename string `json:"filename"`
ContentType string `json:"content_type"`
SizeBytes int64 `json:"size_bytes"`
ETag *string `json:"etag"`
Metadata map[string]any `json:"metadata"`
Status string `json:"status"`
PublicURL *string `json:"public_url"`
UploadExpiresAt *time.Time `json:"upload_expires_at"`
ReadyAt *time.Time `json:"ready_at"`
LastError *string `json:"last_error"`
Version int64 `json:"version"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
Click to show internal directories.
Click to hide internal directories.