storage

package
v0.11.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 15, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend interface {
	Upload(ctx context.Context, localPath string) (location string, err error)
}

Backend abstracts where a recording file is stored after capture.

type FileBackend

type FileBackend struct{}

FileBackend is a no-op backend that returns the local path as-is.

func (FileBackend) Upload

func (FileBackend) Upload(_ context.Context, localPath string) (string, error)

type S3Backend

type S3Backend struct {
	// contains filtered or unexported fields
}

S3Backend uploads recordings to an S3-compatible store.

func NewS3Backend

func NewS3Backend(ctx context.Context, cfg S3Config) (*S3Backend, error)

NewS3Backend creates an S3Backend from the given config. If AccessKey/SecretKey are set, they are used directly; otherwise credentials are resolved via the standard AWS SDK chain.

func NewS3BackendForTest

func NewS3BackendForTest(ctx context.Context, endpoint, bucket, region, accessKey, secretKey string) (*S3Backend, error)

NewS3BackendForTest creates an S3Backend pointing at a test endpoint with static credentials. Useful for integration tests with MinIO.

func NewS3BackendWithClient

func NewS3BackendWithClient(client *s3.Client, bucket, prefix string) *S3Backend

NewS3BackendWithClient creates an S3Backend using a pre-configured S3 client. Useful for testing.

func (*S3Backend) Upload

func (b *S3Backend) Upload(ctx context.Context, localPath string) (string, error)

type S3Config

type S3Config struct {
	Bucket    string
	Region    string
	Endpoint  string
	Prefix    string
	AccessKey string // optional; if set, used instead of default credential chain
	SecretKey string // optional; must be set together with AccessKey
}

S3Config holds configuration for the S3 storage backend.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL