Documentation
¶
Overview ¶
Package objectstore provides an S3-compatible object store for generated assets.
Index ¶
- func AssetKey(orgID, projectID, assetID, ext string) string
- type Config
- type FanoutStore
- type PutOptions
- type S3
- type SnapshotStore
- func (s *SnapshotStore) ForRegion(regionSlug string) *SnapshotStore
- func (s *SnapshotStore) Latest(ctx context.Context) (*snapshot.Snapshot, error)
- func (s *SnapshotStore) Put(ctx context.Context, snap *snapshot.Snapshot) (int64, error)
- func (s *SnapshotStore) Watch(ctx context.Context, pollInterval time.Duration, ...) error
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
Endpoint string // host:port (no scheme), e.g. localhost:9000
AccessKey string
SecretKey string
Region string
Bucket string
UseSSL bool
PathStyle bool
}
Config configures an S3-compatible endpoint.
type FanoutStore ¶ added in v0.3.0
type FanoutStore struct {
Primary snapshot.Store
Mirror *SnapshotStore
}
FanoutStore writes to a primary store then mirrors to an object-store snapshot store.
type PutOptions ¶
PutOptions controls object metadata on write.
type S3 ¶
type S3 struct {
// contains filtered or unexported fields
}
S3 is a MinIO/S3-backed Store.
func (*S3) PresignGet ¶
PresignGet returns a time-limited GET URL.
type SnapshotStore ¶ added in v0.3.0
SnapshotStore implements snapshot.Store using an S3-compatible object store. Layout: {prefix}/{version}.json and {prefix}/latest (plain version number).
func NewSnapshotStore ¶ added in v0.3.0
func NewSnapshotStore(blob Store, prefix string) *SnapshotStore
func (*SnapshotStore) ForRegion ¶ added in v0.3.0
func (s *SnapshotStore) ForRegion(regionSlug string) *SnapshotStore
ForRegion returns a store rooted at {prefix}/{regionSlug}.
func (*SnapshotStore) Latest ¶ added in v0.3.0
Latest loads the snapshot pointed at by the latest pointer.
type Store ¶
type Store interface {
Put(ctx context.Context, key string, body io.Reader, size int64, opts PutOptions) error
Get(ctx context.Context, key string) ([]byte, error)
PresignGet(ctx context.Context, key string, ttl time.Duration) (string, error)
}
Store is the asset / blob persistence port.
Click to show internal directories.
Click to hide internal directories.