Documentation
¶
Index ¶
- Constants
- Variables
- func IsSQLiteArchiveKey(key string, prefix string) bool
- type ArchiveResult
- type CandidateValidation
- type Event
- type EventKind
- type Listing
- type Object
- type ObjectLister
- type ObjectReader
- type ObjectStore
- type ObjectWriter
- type OperationLease
- type Options
- type RestorePlan
- type RestoreResult
- type S3Inspector
- func (i *S3Inspector) ListObjects(ctx context.Context, prefix string, maxObjects int) (Listing, error)
- func (i *S3Inspector) ListObjectsBounded(ctx context.Context, prefix string, maxObjects, maxPages int, ...) (Listing, error)
- func (i *S3Inspector) ListObjectsWithPageTimeout(ctx context.Context, prefix string, maxObjects int, pageTimeout time.Duration) (Listing, error)
- type S3Options
- type S3Reader
- type S3Store
- type StreamLimits
- type StreamResult
Constants ¶
const (
DefaultPrefix = "archive/db"
)
Variables ¶
var ( ErrStreamBudget = errors.New("deep stream budget exhausted") ErrStreamInterrupted = errors.New("deep stream interrupted") ErrCandidateInvalid = errors.New("archive candidate is invalid") )
var ErrOperationLocked = errors.New("SQLite archive operation already running")
Functions ¶
func IsSQLiteArchiveKey ¶ added in v0.7.0
IsSQLiteArchiveKey reports whether key has the canonical SQLite archive name under prefix. Audit adapters use the same predicate as restore selection.
Types ¶
type ArchiveResult ¶
type CandidateValidation ¶ added in v0.7.0
type ObjectLister ¶ added in v0.7.0
type ObjectReader ¶ added in v0.7.0
type ObjectStore ¶
type ObjectStore interface {
ObjectWriter
ObjectLister
ObjectReader
}
type ObjectWriter ¶ added in v0.7.0
type OperationLease ¶ added in v0.7.0
type OperationLease struct {
// contains filtered or unexported fields
}
func AcquireOperationLease ¶ added in v0.7.0
func AcquireOperationLease(cfg config.Config, owner string) (*OperationLease, error)
func (*OperationLease) Close ¶ added in v0.7.0
func (l *OperationLease) Close() error
type Options ¶
type Options struct {
Prefix string
Now func() time.Time
Store ObjectStore
Writer ObjectWriter
OperationLease *OperationLease
Progress func(Event)
// contains filtered or unexported fields
}
type RestorePlan ¶
type RestorePlan struct {
Object Object `json:"object"`
}
type RestoreResult ¶
type RestoreResult struct {
Key string `json:"key"`
RestoredPath string `json:"restored_path"`
BackupPaths []string `json:"backup_paths,omitempty"`
RestoredAt time.Time `json:"restored_at"`
}
func Restore ¶
func Restore(ctx context.Context, cfg config.Config, plan RestorePlan, opts Options) (result RestoreResult, retErr error)
type S3Inspector ¶ added in v0.7.0
type S3Inspector struct {
// contains filtered or unexported fields
}
S3Inspector is deliberately list-only. It cannot write or restore objects.
func NewS3Inspector ¶ added in v0.7.0
func NewS3Inspector(opts S3Options) (*S3Inspector, error)
func (*S3Inspector) ListObjects ¶ added in v0.7.0
func (*S3Inspector) ListObjectsBounded ¶ added in v0.7.0
type S3Reader ¶ added in v0.7.0
type S3Reader struct {
// contains filtered or unexported fields
}
S3Reader is deliberately get-only. It cannot list, write, delete, or restore archive objects.
func NewS3Reader ¶ added in v0.7.0
type S3Store ¶
type S3Store struct {
// contains filtered or unexported fields
}
func NewS3Store ¶
func (*S3Store) ListObjects ¶
type StreamLimits ¶ added in v0.7.0
type StreamResult ¶ added in v0.7.0
type StreamResult struct {
CompressedBytes int64
DecompressedBytes int64
QuickCheck string
IntegrityObserved bool
ForeignKeyViolationCount int
SchemaCompatibility string
SchemaObserved bool
MigrationCompatibility string
MigrationObserved bool
}
func StreamCandidate ¶ added in v0.7.0
func StreamCandidate(ctx context.Context, body io.ReadCloser, temp *vaultfs.PrivateTemp, limits StreamLimits) (StreamResult, error)