archivestore

package
v0.13.2 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2026 License: MIT Imports: 15 Imported by: 2

Documentation

Index

Constants

View Source
const CName = "node.archive.store"

Variables

View Source
var (
	ErrNotFound = errors.New("archive store: not found")
	ErrDisabled = errors.New("archive store is disabled")
)

Functions

This section is empty.

Types

type ArchiveStore

type ArchiveStore interface {
	app.Component
	Get(ctx context.Context, name string) (data io.ReadCloser, err error)
	Put(ctx context.Context, name string, data io.ReadSeeker) (err error)
	Delete(ctx context.Context, name string) (err error)
	// Exists checks the object presence in this node's prefix without fetching it.
	Exists(ctx context.Context, name string) (ok bool, err error)
	// Key returns the full bucket key for the given name in this node's prefix.
	Key(name string) string
	// CopyFrom server-side copies an object from an absolute bucket key
	// (typically another node's prefix in the shared bucket) into this node's prefix.
	CopyFrom(ctx context.Context, srcKey, name string) (err error)
	// Shared reports whether the bucket is shared across the network's tree nodes,
	// enabling S3-mediated space migration.
	Shared() bool
	// List iterates all objects in this node's prefix; iter receives the object
	// name (key without the prefix) and its last-modified time, returning false
	// to stop the iteration.
	List(ctx context.Context, iter func(name string, lastModified time.Time) (bool, error)) (err error)
}

func New

func New() ArchiveStore

type Config

type Config struct {
	Enabled        bool        `yaml:"enabled"`
	Profile        string      `yaml:"profile"`
	Region         string      `yaml:"region"`
	Bucket         string      `yaml:"bucket"`
	Endpoint       string      `yaml:"endpoint"`
	Credentials    Credentials `yaml:"credentials"`
	ForcePathStyle bool        `yaml:"forcePathStyle"`
	KeyPrefix      string      `yaml:"keyPrefix"`
	// Shared marks the bucket as shared across all tree nodes of the network
	// (each node under its own KeyPrefix). Enables S3-mediated space migration
	// (resharding): snapshots are handed between nodes via server-side copy.
	Shared bool `yaml:"shared"`
}

type Credentials

type Credentials struct {
	AccessKey string `yaml:"accessKey"`
	SecretKey string `yaml:"secretKey"`
}

Directories

Path Synopsis
Package mock_archivestore is a generated GoMock package.
Package mock_archivestore is a generated GoMock package.

Jump to

Keyboard shortcuts

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