Documentation
¶
Overview ¶
Package assets is a minimal client for assets-web's authenticated asset store (GET/POST/DELETE /asset/<kind>/<id>), used to promote a staged cover/sample to live (or reclaim it) on volume edit session finalize/accept/reject. See durable-volume-editing in sweetrpg/platform.
Index ¶
- type Client
- func (c *Client) Delete(ctx context.Context, kind, id string) error
- func (c *Client) Get(ctx context.Context, kind, id string) ([]byte, string, error)
- func (c *Client) Promote(ctx context.Context, fromKind, fromID, toKind, toID string) error
- func (c *Client) Store(ctx context.Context, kind, id string, data []byte, contentType string) error
- type NotFoundError
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
}
Client calls assets-web's asset store endpoints.
func NewClient ¶
NewClient builds a Client against assets-web's base URL. An empty baseURL is accepted so the service can still start when ASSETS_WEB_URL isn't configured; every call will then fail with a transport error.
func (*Client) Delete ¶
Delete removes an asset. A missing asset (404) is treated as success - the end state (no asset at kind/id) is the same either way.
type NotFoundError ¶
type NotFoundError struct{ Kind, ID string }
NotFoundError means assets-web has no asset at the given kind/id.
func (NotFoundError) Error ¶
func (e NotFoundError) Error() string