mediaarchive

package
v0.8.13 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2026 License: MIT Imports: 19 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (

	// DefaultPrefix is the fixed remote namespace produced by media archival.
	DefaultPrefix = "media/"
)

Variables

This section is empty.

Functions

func NewS3Client

func NewS3Client(opts Options) (*s3.Client, error)

Types

type InventoryObject added in v0.7.0

type InventoryObject struct {
	Key       string
	SizeBytes int64
}

type InventoryPage added in v0.7.0

type InventoryPage struct {
	Objects   []InventoryObject
	NextToken string
	Complete  bool
}

type ObjectMetadata added in v0.7.0

type ObjectMetadata struct {
	Exists    bool
	SizeBytes int64
}

type Options

type Options struct {
	Limit                 int
	Force                 bool
	Upload                bool
	PruneLocal            bool
	Provider              string
	Bucket                string
	PublicBaseURL         string
	Endpoint              string
	Region                string
	AccessKeyID           string
	SecretKey             string
	SessionToken          string
	PathStyle             bool
	ConnectTimeout        time.Duration
	TLSHandshakeTimeout   time.Duration
	ResponseHeaderTimeout time.Duration
	Uploader              Uploader
	Logger                *slog.Logger
}

type S3Inspector added in v0.7.0

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

func NewS3Inspector added in v0.7.0

func NewS3Inspector(opts Options) (*S3Inspector, error)

func (*S3Inspector) HeadObject added in v0.7.0

func (i *S3Inspector) HeadObject(ctx context.Context, key string) (ObjectMetadata, error)

type S3Inventory added in v0.7.0

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

S3Inventory is a list-only deep-audit capability. It cannot get, put, or delete object data.

func NewS3Inventory added in v0.7.0

func NewS3Inventory(opts Options) (*S3Inventory, error)

func (*S3Inventory) ListPage added in v0.7.0

func (i *S3Inventory) ListPage(ctx context.Context, prefix, token string, maxKeys int) (InventoryPage, error)

type S3Uploader

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

func NewS3Uploader

func NewS3Uploader(opts Options) (*S3Uploader, error)

func (*S3Uploader) Upload

type Stats

type Stats struct {
	Candidates       int   `json:"candidates"`
	Uploaded         int   `json:"uploaded"`
	Archived         int   `json:"archived"`
	Unchanged        int   `json:"unchanged"`
	PruneSkipped     int   `json:"prune_skipped"`
	LocalFilesPruned int   `json:"local_files_pruned"`
	LocalRowsPruned  int64 `json:"local_rows_pruned"`
	Errors           int   `json:"errors"`
}

func Run

func Run(ctx context.Context, cfg config.Config, st *store.Store, opts Options) (Stats, error)

type Uploader

type Uploader interface {
	Upload(ctx context.Context, cfg config.Config, asset model.MediaAsset, opts Options) (model.MediaArchiveResult, bool, error)
}

Jump to

Keyboard shortcuts

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