Documentation
¶
Overview ¶
Package objstore implements a Supabase-compatible object storage HTTP handler backed by the local filesystem. It is used by supatype-server in dev mode (STORAGE_PROVIDER=local) so that storage works out of the box with no MinIO or external service required.
The HTTP API surface is identical to the supatype/storage Node.js service, so the @supatype/client SDK works without any changes.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Handler ¶
Handler returns an http.Handler that implements the Supabase-compatible object storage API backed by local disk at storageRoot.
jwtSecret is the HS256 secret used to validate Bearer tokens — the same value as GOTRUE_JWT_SECRET set by the CLI (local dev JWT secret).
The handler is designed to be mounted with http.StripPrefix("/storage/v1") so all routes below are relative to that prefix.
Types ¶
type Bucket ¶
type Bucket struct {
ID string `json:"id"`
Name string `json:"name"`
Public bool `json:"public"`
FileSizeLimit *int64 `json:"file_size_limit"`
AllowedMimeTypes []string `json:"allowed_mime_types"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
}
Bucket mirrors the StorageBucketMeta shape expected by @supatype/client.
type ObjectMeta ¶
type ObjectMeta struct {
ID string `json:"id"`
Name string `json:"name"`
BucketID string `json:"bucket_id"`
Owner string `json:"owner"`
ContentType string `json:"content_type,omitempty"`
Size int64 `json:"size"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
LastAccessedAt string `json:"last_accessed_at"`
}
ObjectMeta is the on-disk sidecar format for a stored object.