Documentation
¶
Index ¶
- Variables
- type Inspector
- type Local
- func (l *Local) Delete(ctx context.Context, key string) error
- func (l *Local) Get(ctx context.Context, key string) (Object, error)
- func (l *Local) Put(ctx context.Context, object Object) error
- func (l *Local) SignedURL(_ context.Context, key string, ttl time.Duration) (string, error)
- func (l *Local) Stat(ctx context.Context, key string) (StoredObject, error)
- type Memory
- func (m *Memory) Delete(_ context.Context, key string) error
- func (m *Memory) Get(_ context.Context, key string) (Object, error)
- func (m *Memory) Len() int
- func (m *Memory) Put(_ context.Context, object Object) error
- func (m *Memory) SignedURL(_ context.Context, key string, ttl time.Duration) (string, error)
- func (m *Memory) Stat(_ context.Context, key string) (StoredObject, error)
- type Object
- type S3Config
- type S3Store
- func (s *S3Store) Delete(ctx context.Context, key string) error
- func (s *S3Store) Get(ctx context.Context, key string) (Object, error)
- func (s *S3Store) Put(ctx context.Context, object Object) error
- func (s *S3Store) SignedURL(_ context.Context, key string, ttl time.Duration) (string, error)
- func (s *S3Store) Stat(ctx context.Context, key string) (StoredObject, error)
- type Storage
- type StoredObject
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUnsupported = errors.New("storage operation is not supported by this adapter") ErrNotFound = errors.New("object not found") )
Functions ¶
This section is empty.
Types ¶
type Inspector ¶
type Inspector interface {
Stat(ctx context.Context, key string) (StoredObject, error)
}
type Local ¶
type Local struct {
// contains filtered or unexported fields
}
type Memory ¶
type Memory struct {
// contains filtered or unexported fields
}
Memory is a thread-safe in-memory storage adapter, primarily for tests.
func NewMemory ¶
NewMemory creates a new in-memory storage backend. publicURL is an optional base URL used to build object URLs (can be empty).
type S3Store ¶
type S3Store struct {
// contains filtered or unexported fields
}
S3Store implements Storage and Inspector for any S3-compatible object store (AWS S3, Cloudflare R2, MinIO, etc.) using only the standard library. Authentication uses AWS Signature Version 4.
func NewS3 ¶
NewS3 creates an S3Store from the provided config. Region defaults to "us-east-1" when empty. ForcePathStyle or a non-empty Endpoint both enable path-style URLs.
Click to show internal directories.
Click to hide internal directories.