{"modulePath":"github.com/darron/dbrain","version":"v0.8.27","isLatest":true,"isStandardLibrary":false,"goos":"linux","goarch":"amd64","docs":"# package sqlitearchive\n\n## Constants\n\n```go\nconst (\n\tDefaultPrefix = \"archive/db\"\n)\n```\n\n## Variables\n\n```go\nvar (\n\tErrStreamBudget      = errors.New(\"deep stream budget exhausted\")\n\tErrStreamInterrupted = errors.New(\"deep stream interrupted\")\n\tErrCandidateInvalid  = errors.New(\"archive candidate is invalid\")\n)\n```\n\n```go\nvar ErrOperationLocked = errors.New(\"SQLite archive operation already running\")\n```\n\n## Functions\n\n```go\nfunc IsSQLiteArchiveKey(key string, prefix string) bool\n```\nIsSQLiteArchiveKey reports whether key has the canonical SQLite archive name under prefix. Audit adapters use the same predicate as restore selection.\n\n## Types\n\n```go\ntype ArchiveResult struct {\n\tKey          string    `json:\"key\"`\n\tLocalDBPath  string    `json:\"local_db_path\"`\n\tSnapshotSize int64     `json:\"snapshot_size\"`\n\tArchiveSize  int64     `json:\"archive_size\"`\n\tETag         string    `json:\"etag,omitempty\"`\n\tArchivedAt   time.Time `json:\"archived_at\"`\n}\n```\n\n```go\nfunc Archive(ctx context.Context, cfg config.Config, opts Options) (result ArchiveResult, retErr error)\n```\n\n```go\ntype CandidateValidation struct {\n\tQuickCheck               string\n\tIntegrityObserved        bool\n\tForeignKeyViolationCount int\n\tSchemaCompatibility      string\n\tSchemaObserved           bool\n\tMigrationCompatibility   string\n\tMigrationObserved        bool\n}\n```\n\n```go\ntype Event struct {\n\tKind    EventKind\n\tStage   string\n\tMessage string\n\tCurrent int64\n\tTotal   int64\n}\n```\n\n```go\ntype EventKind string\n```\n\n```go\nconst (\n\tEventStageStart       EventKind = \"stage_start\"\n\tEventStageDone        EventKind = \"stage_done\"\n\tEventTransferProgress EventKind = \"transfer_progress\"\n)\n```\n\n```go\ntype Listing struct {\n\tObjects  []Object\n\tComplete bool\n}\n```\n\n```go\ntype Object struct {\n\tKey          string    `json:\"key\"`\n\tLastModified time.Time `json:\"last_modified\"`\n\tSize         int64     `json:\"size\"`\n}\n```\n\n```go\ntype ObjectLister interface {\n\tListObjects(ctx context.Context, prefix string) ([]Object, error)\n}\n```\n\n```go\ntype ObjectReader interface {\n\tGetObject(ctx context.Context, key string) (io.ReadCloser, error)\n}\n```\n\n```go\ntype ObjectStore interface {\n\tObjectWriter\n\tObjectLister\n\tObjectReader\n}\n```\n\n```go\ntype ObjectWriter interface {\n\tPutObject(ctx context.Context, key string, body io.Reader, contentType string, contentLength int64) (string, error)\n}\n```\n\n```go\ntype OperationLease struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc AcquireOperationLease(cfg config.Config, owner string) (*OperationLease, error)\n```\n\n```go\nfunc (l *OperationLease) Close() error\n```\n\n```go\ntype Options struct {\n\tPrefix         string\n\tNow            func() time.Time\n\tStore          ObjectStore\n\tWriter         ObjectWriter\n\tOperationLease *OperationLease\n\tProgress       func(Event)\n\t// contains filtered or unexported fields\n}\n```\n\n```go\ntype RestorePlan struct {\n\tObject Object `json:\"object\"`\n}\n```\n\n```go\nfunc Latest(ctx context.Context, opts Options) (RestorePlan, error)\n```\n\n```go\ntype RestoreResult struct {\n\tKey          string    `json:\"key\"`\n\tRestoredPath string    `json:\"restored_path\"`\n\tBackupPaths  []string  `json:\"backup_paths,omitempty\"`\n\tRestoredAt   time.Time `json:\"restored_at\"`\n}\n```\n\n```go\nfunc Restore(ctx context.Context, cfg config.Config, plan RestorePlan, opts Options) (result RestoreResult, retErr error)\n```\n\n```go\ntype S3Inspector struct {\n\t// contains filtered or unexported fields\n}\n```\nS3Inspector is deliberately list-only. It cannot write or restore objects.\n\n```go\nfunc NewS3Inspector(opts S3Options) (*S3Inspector, error)\n```\n\n```go\nfunc (i *S3Inspector) ListObjects(ctx context.Context, prefix string, maxObjects int) (Listing, error)\n```\n\n```go\nfunc (i *S3Inspector) ListObjectsBounded(ctx context.Context, prefix string, maxObjects, maxPages int, pageTimeout time.Duration) (Listing, error)\n```\n\n```go\nfunc (i *S3Inspector) ListObjectsWithPageTimeout(ctx context.Context, prefix string, maxObjects int, pageTimeout time.Duration) (Listing, error)\n```\n\n```go\ntype S3Options struct {\n\tBucket                string\n\tEndpoint              string\n\tRegion                string\n\tAccessKeyID           string\n\tSecretKey             string\n\tSessionToken          string\n\tPathStyle             bool\n\tConnectTimeout        time.Duration\n\tTLSHandshakeTimeout   time.Duration\n\tResponseHeaderTimeout time.Duration\n}\n```\n\n```go\ntype S3Reader struct {\n\t// contains filtered or unexported fields\n}\n```\nS3Reader is deliberately get-only. It cannot list, write, delete, or restore archive objects.\n\n```go\nfunc NewS3Reader(opts S3Options) (*S3Reader, error)\n```\n\n```go\nfunc (r *S3Reader) Open(ctx context.Context, key string) (io.ReadCloser, error)\n```\n\n```go\ntype S3Store struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewS3Store(opts S3Options) (*S3Store, error)\n```\n\n```go\nfunc (s *S3Store) GetObject(ctx context.Context, key string) (io.ReadCloser, error)\n```\n\n```go\nfunc (s *S3Store) ListObjects(ctx context.Context, prefix string) ([]Object, error)\n```\n\n```go\nfunc (s *S3Store) PutObject(ctx context.Context, key string, body io.Reader, contentType string, contentLength int64) (string, error)\n```\n\n```go\ntype StreamLimits struct {\n\tMaxCompressedBytes int64\n\tMaxDatabaseBytes   int64\n\tMaxTempBytes       int64\n\tReadIdleTimeout    time.Duration\n}\n```\n\n```go\ntype StreamResult struct {\n\tCompressedBytes          int64\n\tDecompressedBytes        int64\n\tQuickCheck               string\n\tIntegrityObserved        bool\n\tForeignKeyViolationCount int\n\tSchemaCompatibility      string\n\tSchemaObserved           bool\n\tMigrationCompatibility   string\n\tMigrationObserved        bool\n}\n```\n\n```go\nfunc StreamCandidate(ctx context.Context, body io.ReadCloser, temp *vaultfs.PrivateTemp, limits StreamLimits) (StreamResult, error)\n```\n\n","path":"github.com/darron/dbrain/internal/sqlitearchive","name":"sqlitearchive","synopsis":"","isRedistributable":true}
