Documentation
¶
Overview ¶
Package storage provides a client for Supabase Storage API
Index ¶
- type Client
- func (c *Client) Delete(ctx context.Context, bucket, path string) error
- func (c *Client) GetPublicURL(bucket, path string) string
- func (c *Client) GetSignedURL(ctx context.Context, bucket, path string, expiresIn int) (string, error)
- func (c *Client) Upload(ctx context.Context, bucket, path string, data []byte, contentType string) (string, error)
- func (c *Client) UploadWithOptions(ctx context.Context, bucket, path string, data []byte, options UploadOptions) (string, error)
- type UploadOptions
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 provides methods to interact with Supabase Storage
func New ¶
New creates a new Storage client. publishableKey is used for the apikey header (project identification). secretKey is used for the Authorization header (service_role access). If publishableKey is empty, secretKey is used for both headers (legacy behaviour).
func (*Client) GetPublicURL ¶
GetPublicURL returns the public URL for a file (if bucket is public)
func (*Client) GetSignedURL ¶
func (c *Client) GetSignedURL(ctx context.Context, bucket, path string, expiresIn int) (string, error)
GetSignedURL returns a signed URL for temporary access to a private file
func (*Client) Upload ¶
func (c *Client) Upload(ctx context.Context, bucket, path string, data []byte, contentType string) (string, error)
Upload uploads a file to the specified bucket and path Returns the full path of the uploaded file
func (*Client) UploadWithOptions ¶
func (c *Client) UploadWithOptions(ctx context.Context, bucket, path string, data []byte, options UploadOptions) (string, error)
UploadWithOptions uploads a file to the specified bucket and path with optional headers. Returns the full path of the uploaded file.
type UploadOptions ¶
UploadOptions configures a storage upload request.