Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureBlobRecorded ¶
func EnsureBlobRecorded( ctx context.Context, q *dbq.Queries, sha256 string, kind string, sizeBytes int64, originalName *string, ) error
EnsureBlobRecorded ensures the blobs table has a row for sha256, enforcing invariants:
- if the blob already exists, its kind and size must match
- otherwise, insert it
verified_at is set only on insert. For existing blobs, verified_at is reserved for doctor --deep (rehash verification), not for "we saw a file".
Types ¶
type BackupResult ¶
type BackupResult struct {
SHA256Hex string
SizeBytes int64
// Existed is true if the blob was already in the backup store (deduped)
Existed bool
}
BackupResult is the outcome of a successful IngestBackup call
func IngestBackup ¶
func IngestBackup( ctx context.Context, db *sql.DB, q *dbq.Queries, bs Store, srcPath string, gameInstallID int64, targetID int64, relpath string, operationID sql.NullInt64, originalContentSha256 string, ) (BackupResult, error)
IngestBackup copies srcPath into the backup blob store, records the blob, and upserts the backups row - all within a single transaction.
srcPath is the on-disk path of the pre-existing file to back up. originalContentSha256 is the hash of the file computed before ingestion, if already available; pass empty string if not.
type IngestResult ¶
Click to show internal directories.
Click to hide internal directories.