Documentation
¶
Overview ¶
Package objectstores3 provides a supported-adapter S3-compatible object store.
Use New with Options to configure endpoint, region, bucket, credentials, content policy, and HTTP client behavior for objectstore.Store. Store implements put, get, delete, signed URL generation, not-found mapping, metadata mapping, and SigV4 signing for S3-compatible services.
Validate object references and size/content-type policy before network I/O. Do not log access keys, signed URLs, object contents, or tenant-derived object keys as operational evidence.
Index ¶
- Variables
- type Options
- type Store
- func (s *Store) Delete(ctx context.Context, ref objectstore.Ref) error
- func (s *Store) Get(ctx context.Context, ref objectstore.Ref) (objectstore.GetResult, error)
- func (s *Store) HealthChecker() ports.HealthChecker
- func (s *Store) Put(ctx context.Context, ref objectstore.Ref, body io.Reader, ...) error
- func (s *Store) SignedURL(ctx context.Context, ref objectstore.Ref, opts objectstore.SignedURLOptions) (string, error)
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalidConfig reports invalid S3 adapter configuration. ErrInvalidConfig = errors.New("invalid s3 object store config") // ErrStoreNotConfigured reports a nil or incomplete store. ErrStoreNotConfigured = errors.New("s3 object store not configured") )
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct {
Endpoint string
Region string
Bucket string
AccessKeyID string
SecretAccessKey string
SessionToken string
HTTPClient *http.Client
Clock func() time.Time
MaxObjectSize int64
AllowedContentTypes []string
}
Options configures an S3-compatible object store.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store implements objectstore.Store using the S3 HTTP API and SigV4 signing.
func (*Store) Delete ¶
Delete removes an object. Missing objects are treated as successfully deleted.
func (*Store) Get ¶
func (s *Store) Get(ctx context.Context, ref objectstore.Ref) (objectstore.GetResult, error)
Get reads an object. The caller owns the returned body.
func (*Store) HealthChecker ¶
func (s *Store) HealthChecker() ports.HealthChecker
HealthChecker returns a bucket-level health checker for this store.
func (*Store) Put ¶
func (s *Store) Put(ctx context.Context, ref objectstore.Ref, body io.Reader, opts objectstore.PutOptions) error
Put writes an object.
func (*Store) SignedURL ¶
func (s *Store) SignedURL(ctx context.Context, ref objectstore.Ref, opts objectstore.SignedURLOptions) (string, error)
SignedURL creates a SigV4 pre-signed URL for a supported S3 object operation.