Documentation
¶
Overview ¶
Package docbank provides an in-process Docbank vault for Go applications. Standalone CLI commands remain daemon clients; embedded applications own the same exclusive vault lock, metadata schema, and mixed loose/packed storage directly through this lifecycle.
Index ¶
- Constants
- Variables
- type BatchMoveItem
- type BatchMoveReceipt
- type ChildrenOptions
- type ChildrenPage
- type Config
- type Content
- type ContentIdentity
- type ContentVersion
- type CreateOptions
- type GCOptions
- type GCReport
- type LooseBacklog
- type LooseCompressionOptions
- type MaintenanceProgress
- type MutationReceipt
- type Node
- type PackOptions
- type PackReport
- type PhysicalContent
- type ProvenanceFact
- type ProvenanceOptions
- type ProvenancePage
- type ProvenanceSource
- type PutOptions
- type PutReceipt
- type RepackOptions
- type RepackReport
- type RepairReceipt
- type ResetOptions
- type RevisionOptions
- type StoreBinding
- type TrashEmptyOptions
- type TrashEmptyReport
- type Vault
- func (v *Vault) BatchMove(ctx context.Context, moves []BatchMoveItem) ([]BatchMoveReceipt, error)
- func (v *Vault) Children(ctx context.Context, directoryID int64, opts ChildrenOptions) (ChildrenPage, error)
- func (v *Vault) Close() error
- func (v *Vault) Create(ctx context.Context, virtualPath string, content io.Reader, opts CreateOptions) (PutReceipt, error)
- func (v *Vault) EmptyTrash(ctx context.Context, opts TrashEmptyOptions) (TrashEmptyReport, error)
- func (v *Vault) GarbageCollect(ctx context.Context, opts GCOptions) (GCReport, error)
- func (v *Vault) ID() string
- func (v *Vault) LooseBacklog(ctx context.Context) (LooseBacklog, error)
- func (v *Vault) MovePath(ctx context.Context, from, to string, opts RevisionOptions) (MutationReceipt, error)
- func (v *Vault) OpenContent(ctx context.Context, virtualPath string) (*Content, error)
- func (v *Vault) OpenVersionContent(ctx context.Context, versionID string) (*VersionContent, error)
- func (v *Vault) Pack(ctx context.Context, opts PackOptions) (PackReport, error)
- func (v *Vault) Provenance(ctx context.Context, nodeID int64, opts ProvenanceOptions) (ProvenancePage, error)
- func (v *Vault) Put(ctx context.Context, virtualPath string, content io.Reader, opts PutOptions) (PutReceipt, error)
- func (v *Vault) Repack(ctx context.Context, opts RepackOptions) (RepackReport, error)
- func (v *Vault) RepairContent(ctx context.Context, identity ContentIdentity, trusted io.Reader) (RepairReceipt, error)
- func (v *Vault) Restore(ctx context.Context, nodeID int64, opts RevisionOptions) (MutationReceipt, error)
- func (v *Vault) SQLiteDriver() string
- func (v *Vault) Stat(ctx context.Context, virtualPath string) (Node, error)
- func (v *Vault) TrashPath(ctx context.Context, path string, opts RevisionOptions) (MutationReceipt, error)
- func (v *Vault) Verify(ctx context.Context, opts VerifyOptions) (VerifyReport, error)
- func (v *Vault) Versions(ctx context.Context, nodeID int64, opts VersionsOptions) (VersionsPage, error)
- func (v *Vault) Walk(ctx context.Context, rootPath string, opts WalkOptions) (*Walker, error)
- type VerifiedReadCloser
- type VerifyOptions
- type VerifyProblem
- type VerifyReport
- type VersionContent
- type VersionsOptions
- type VersionsPage
- type WalkEntry
- type WalkOptions
- type Walker
- type WorkBudget
Constants ¶
const ( DefaultMaintenanceMaxObjects = internalmaintenance.DefaultMaxObjects MaxMaintenanceObjects = internalmaintenance.MaxObjectsPerOperation )
const ( DefaultProvenanceLimit = 100 MaxProvenanceLimit = store.MaxProvenancePageSize )
const ( DefaultVersionsLimit = 100 MaxVersionsLimit = 1000 )
const ( // DefaultChildrenLimit is the page size used when ChildrenOptions.Limit is zero. DefaultChildrenLimit = 500 // MaxChildrenLimit is the largest child page one embedded call may materialize. MaxChildrenLimit = 5000 // DefaultTrashEmptyMaxRoots bounds one EmptyTrash call when MaxRoots is zero. DefaultTrashEmptyMaxRoots = 100 )
const ( // DefaultWalkPageSize is the finite page size used when WalkOptions.PageSize is zero. DefaultWalkPageSize = 500 // MaxWalkPageSize is the largest page one Walker may materialize. MaxWalkPageSize = store.MaxWalkPageSize // MaxWalkDepth is the greatest absolute tree depth one Walker traverses. MaxWalkDepth = store.MaxWalkDepth // MaxWalkPathBytes is the largest canonical path one Walker materializes. MaxWalkPathBytes = store.MaxWalkPathBytes )
const MaxBatchMoves = store.MaxBatchMoves
MaxBatchMoves is the largest all-or-nothing reorganization accepted by one embedded or daemon operation.
Variables ¶
var ( // ErrClosed means an operation targeted a closed embedded vault. ErrClosed = errors.New("docbank vault is closed") // opened or its physical size disagreed with the metadata authority. ErrContentUnavailable = errors.New("docbank content is unavailable") // ErrDigestMismatch means the durable bytes did not match the caller's // optional expected SHA-256 identity. ErrDigestMismatch = errors.New("docbank content digest mismatch") // ErrSizeMismatch means the durable bytes did not match the caller's // optional expected byte count. ErrSizeMismatch = errors.New("docbank content size mismatch") // ErrContentConflict means immutable creation targeted an existing path // with different bytes, size, media type, provenance, or node kind. ErrContentConflict = errors.New("docbank immutable content conflict") ErrNotFound = store.ErrNotFound ErrExists = store.ErrExists ErrNotDirectory = store.ErrNotDir ErrNotFile = store.ErrNotFile ErrStaleRevision = store.ErrStaleRevision ErrCycle = store.ErrCycle ErrInvalidName = store.ErrInvalidName ErrInvalidBatchMove = store.ErrInvalidBatchMove ErrNotTrashed = store.ErrNotTrashed ErrIsRoot = store.ErrIsRoot ErrAuditMutationUnsupported = store.ErrAuditMutationUnsupported )
var ErrInvalidMaintenanceCursor = internalmaintenance.ErrInvalidCursor
Functions ¶
This section is empty.
Types ¶
type BatchMoveItem ¶ added in v0.10.1
type BatchMoveItem struct {
SourcePath string `json:"source_path,omitzero"`
NodeID int64 `json:"node_id,omitzero"`
IfRevision int64 `json:"if_revision,omitzero"`
DestinationPath string `json:"destination_path"`
}
BatchMoveItem identifies one live source either by SourcePath or by stable NodeID plus IfRevision. DestinationPath is an exact final coordinate whose parent is resolved in the batch's planned final tree.
type BatchMoveReceipt ¶ added in v0.10.1
type BatchMoveReceipt struct {
Node Node `json:"node"`
FromPath string `json:"from_path"`
Path string `json:"path"`
}
BatchMoveReceipt binds one request to its stable node and transactional pre/post coordinates.
type ChildrenOptions ¶
ChildrenOptions selects one bounded page of a directory's live children. A zero Limit uses DefaultChildrenLimit. Offset must not be negative.
type ChildrenPage ¶
type ChildrenPage struct {
Items []Node `json:"items"`
Total int `json:"total"`
Limit int `json:"limit"`
Offset int `json:"offset"`
}
ChildrenPage is one bounded dirs-first, name-sorted child listing.
type Config ¶
type Config struct {
Root string
SQLite docsqlite.Driver
LooseCompression LooseCompressionOptions
StoreBindings map[string]StoreBinding
}
Config selects one private vault root, its optional SQLite implementation, and physical loose-storage policy. Nil SQLite uses mattn/go-sqlite3 in CGO builds and modernc.org/sqlite when CGO is disabled.
type Content ¶
type Content struct {
Node Node
Reader VerifiedReadCloser
}
Content binds a verified current-byte stream to its stable node projection.
type ContentIdentity ¶
ContentIdentity is the canonical identity of uncompressed document bytes.
type ContentVersion ¶
type ContentVersion struct {
ID string `json:"id"`
NodeID int64 `json:"node_id"`
BlobHash string `json:"blob_hash"`
Size int64 `json:"size"`
MediaType string `json:"media_type,omitzero"`
RecordedAt string `json:"recorded_at"`
NodeRevision int64 `json:"node_revision"`
IntroducedOperationID string `json:"introduced_operation_id"`
TransitionKind string `json:"transition_kind"`
SourceVersionID *string `json:"source_version_id,omitempty"`
}
ContentVersion is one immutable byte identity in a stable file's history.
type CreateOptions ¶ added in v0.10.0
type CreateOptions struct {
MediaType string
Expected ContentIdentity
// Provenance optionally records where this immutable document came from.
// The source fact commits atomically with a newly created node and version.
Provenance *ProvenanceSource
}
CreateOptions controls one immutable content creation. Expected is required; an existing path is idempotent only when bytes, size, and media type match.
type GCOptions ¶ added in v0.10.0
type GCOptions struct {
Budget WorkBudget
DryRun bool
}
type GCReport ¶ added in v0.10.0
type GCReport struct {
MaintenanceProgress
CandidateBlobs int `json:"candidate_blobs"`
UntrackedFiles int `json:"untracked_files"`
ReclaimableBytes int64 `json:"reclaimable_bytes"`
PendingPackedBlobs int `json:"pending_packed_blobs"`
PendingPackedBytes int64 `json:"pending_packed_bytes"`
ReclaimedFiles int `json:"reclaimed_files"`
RemovedBlobs int `json:"removed_blobs"`
Removed int `json:"removed"`
DryRun bool `json:"dry_run"`
}
GCReport summarizes one bounded catalog-authority reclamation pass.
type LooseBacklog ¶ added in v0.10.0
type LooseBacklog struct {
EligibleObjects int64 `json:"eligible_objects"`
EligibleBytes int64 `json:"eligible_bytes"`
EligibleStoredBytes int64 `json:"eligible_stored_bytes"`
RawObjects int64 `json:"raw_objects"`
CompressedObjects int64 `json:"compressed_objects"`
}
LooseBacklog summarizes loose content eligible for explicit packing.
type LooseCompressionOptions ¶ added in v0.10.0
LooseCompressionOptions controls whether eligible new loose content may use zstd physical storage. The zero value preserves the legacy raw layout.
type MaintenanceProgress ¶ added in v0.10.0
type MutationReceipt ¶ added in v0.10.0
MutationReceipt binds the resulting node projection to the canonical path captured in the same metadata transaction.
type Node ¶
type Node struct {
ID int64 `json:"id"`
ParentID *int64 `json:"parent_id,omitempty"`
Name string `json:"name"`
Kind string `json:"kind"`
CurrentVersionID string `json:"current_version_id,omitzero"`
BlobHash string `json:"blob_hash,omitzero"`
Size int64 `json:"size"`
MediaType string `json:"media_type,omitzero"`
Revision int64 `json:"revision"`
CreatedAt string `json:"created_at"`
ModifiedAt string `json:"modified_at"`
TrashedAt *string `json:"trashed_at,omitempty"`
}
Node is the current projection of one stable virtual-tree identity.
type PackOptions ¶
type PackOptions struct {
MaxBytes int64
}
PackOptions bounds one explicit embedded packing pass. MaxBytes is a soft committed raw-byte budget; zero is unlimited and negative values are rejected.
type PackReport ¶
type PackReport struct {
PacksSealed int `json:"packs_sealed"`
BlobsPacked int `json:"blobs_packed"`
BytesPacked int64 `json:"bytes_packed"`
PacksAdopted int `json:"packs_adopted"`
PacksRemoved int `json:"packs_removed"`
PacksQuarantined int `json:"packs_quarantined"`
PacksUnreadable int `json:"packs_unreadable"`
RecordsDropped int `json:"records_dropped"`
MappingsPruned int64 `json:"mappings_pruned"`
BlobsMissing int `json:"blobs_missing"`
BlobsCorrupt int `json:"blobs_corrupt"`
BlobsDeferredOversized int `json:"blobs_deferred_oversized"`
PacksDeferredOversized int `json:"packs_deferred_oversized"`
LooseSwept int `json:"loose_swept"`
LooseOrphansRemoved int `json:"loose_orphans_removed"`
LooseOrphanSweepSuppressed bool `json:"loose_orphan_sweep_suppressed"`
BudgetExhausted bool `json:"budget_exhausted"`
More bool `json:"more"`
}
PackReport summarizes one explicit packing and repair pass.
type PhysicalContent ¶ added in v0.10.0
type PhysicalContent struct {
Kind string `json:"kind"`
Encoding string `json:"encoding"`
LogicalBytes int64 `json:"logical_bytes"`
StoredBytes int64 `json:"stored_bytes"`
PackEligible bool `json:"pack_eligible"`
}
PhysicalContent describes the representation with current catalog authority. Logical identity is always SHA-256 over decoded bytes.
type ProvenanceFact ¶ added in v0.11.0
type ProvenanceFact struct {
Identity string `json:"identity"`
NodeID int64 `json:"node_id"`
IngestID string `json:"ingest_id"`
RecordedAt string `json:"recorded_at"`
SourceKind string `json:"source_kind"`
SourceDescription string `json:"source_description"`
SourceReference string `json:"source_reference"`
SourceModifiedAt *string `json:"source_modified_at,omitempty"`
Supersedes *string `json:"supersedes,omitempty"`
Active bool `json:"active"`
}
ProvenanceFact is one immutable statement about where a document came from. Superseded facts remain visible; Active marks the current unsuperseded facts.
type ProvenanceOptions ¶ added in v0.11.0
ProvenanceOptions selects one bounded newest-first provenance page.
type ProvenancePage ¶ added in v0.11.0
type ProvenancePage struct {
Node Node `json:"node"`
Path string `json:"path,omitzero"`
Items []ProvenanceFact `json:"items"`
Total int `json:"total"`
Limit int `json:"limit"`
Offset int `json:"offset"`
}
ProvenancePage binds origin history to a transactionally consistent node. Path is empty when the node is in trash.
type ProvenanceSource ¶ added in v0.11.0
type ProvenanceSource struct {
Kind string `json:"kind"`
Description string `json:"description"`
Reference string `json:"reference"`
ModifiedAt *time.Time `json:"modified_at,omitempty"`
}
ProvenanceSource describes an application-neutral origin for one immutable document creation. Reference may be a URI, archive key, filesystem path, or another stable source-local identifier; Docbank does not interpret it.
type PutOptions ¶
type PutOptions struct {
MediaType string
Expected *ContentIdentity
}
PutOptions controls one embedded content write. Expected is optional; when present, no node or version authority is granted unless both fields match the independently computed durable bytes.
type PutReceipt ¶
type PutReceipt struct {
Node Node `json:"node"`
Version ContentVersion `json:"version"`
Computed ContentIdentity `json:"computed"`
Physical PhysicalContent `json:"physical"`
Created bool `json:"created"`
PhysicalCreated bool `json:"physical_created"`
Replaced bool `json:"replaced"`
}
PutReceipt proves the computed identity and resulting logical authority.
type RepackOptions ¶ added in v0.10.0
type RepackOptions struct {
Budget WorkBudget
MinAge time.Duration
MinDeadBytes int64
}
type RepackReport ¶ added in v0.10.0
type RepackReport struct {
MaintenanceProgress
MappingsPruned int64 `json:"mappings_pruned"`
PacksSelected int `json:"packs_selected"`
PacksRewritten int `json:"packs_rewritten"`
PacksSealed int `json:"packs_sealed"`
PacksRemoved int `json:"packs_removed"`
PacksDeferredOversized int `json:"packs_deferred_oversized"`
BlobsRepacked int `json:"blobs_repacked"`
BytesRepacked int64 `json:"bytes_repacked"`
BudgetExhausted bool `json:"budget_exhausted"`
}
RepackReport summarizes one bounded immutable-pack reclamation pass.
type RepairReceipt ¶ added in v0.10.0
type RepairReceipt struct {
Computed ContentIdentity `json:"computed"`
Physical PhysicalContent `json:"physical"`
ReferencesPreserved int64 `json:"references_preserved"`
}
RepairReceipt proves the replacement bytes and reports the resulting physical authority without changing any logical node or version.
type ResetOptions ¶ added in v0.11.0
ResetOptions defines the explicit move-aside boundary for ResetVault. ReleaseCurrent, when set, is called exactly once after reset excludes every overlapping hierarchy-owner acquisition and validates both paths, but before it takes ordinary ownership of the source directory. Embedded applications use it to hand an already-open vault and any surrounding lifecycle state to reset without an ownership gap.
type RevisionOptions ¶ added in v0.10.0
type RevisionOptions struct {
IfRevision int64 `json:"if_revision,omitzero"`
}
RevisionOptions applies an optional lost-update guard to one tree mutation. Zero is unconditional; a positive value must match the node's revision.
type StoreBinding ¶ added in v0.12.0
type StoreBinding struct {
Kind string
Path string
Endpoint string
Region string
Bucket string
Prefix string
CredentialProfile string
Priority int
ForcePathStyle bool
}
StoreBinding configures one embedded secondary namespace without exposing Kit backend types through Docbank's public API.
type TrashEmptyOptions ¶ added in v0.10.0
type TrashEmptyOptions struct {
OlderThan time.Duration `json:"older_than"`
MaxRoots int `json:"max_roots,omitzero"`
DryRun bool `json:"dry_run"`
}
TrashEmptyOptions bounds one trash-empty preview or execution. A zero MaxRoots uses DefaultTrashEmptyMaxRoots. DryRun never deletes candidates.
type TrashEmptyReport ¶ added in v0.10.0
type TrashEmptyReport struct {
Candidates int64 `json:"candidates"`
Deleted int64 `json:"deleted"`
More bool `json:"more"`
DryRun bool `json:"dry_run"`
}
TrashEmptyReport summarizes one bounded batch of eligible trash roots.
type Vault ¶
type Vault struct {
// contains filtered or unexported fields
}
Vault is one independently locked Docbank namespace. Separate Vault values may be open concurrently when their roots do not overlap.
func New ¶
New creates or opens one embedded vault and holds its exclusive hierarchy lock until Close. A standalone daemon or another embedded instance cannot own the same or an overlapping vault concurrently.
func ResetVault ¶ added in v0.11.0
func ResetVault( ctx context.Context, config Config, opts ResetOptions, ) (fresh *Vault, retErr error)
ResetVault atomically moves an existing vault to an absent diagnostic sibling and creates a fresh vault at the original canonical path. It never opens the source catalog and never deletes the source, diagnostic, or a partially initialized fresh vault. The returned fresh vault retains ordinary exclusive hierarchy ownership until Close.
func (*Vault) BatchMove ¶ added in v0.10.1
func (v *Vault) BatchMove( ctx context.Context, moves []BatchMoveItem, ) ([]BatchMoveReceipt, error)
BatchMove validates and applies one final-state reorganization as a single metadata transaction. Results preserve request order. Path sources resolve inside the transaction; stable node sources require a positive revision.
func (*Vault) Children ¶
func (v *Vault) Children( ctx context.Context, directoryID int64, opts ChildrenOptions, ) (ChildrenPage, error)
Children lists one bounded page of a directory's live children, directories first and then files, name-sorted within each kind.
func (*Vault) Close ¶
Close waits for active operations and readers, then releases storage and the vault hierarchy lock. It is safe to call more than once.
func (*Vault) Create ¶ added in v0.10.0
func (v *Vault) Create( ctx context.Context, virtualPath string, content io.Reader, opts CreateOptions, ) (PutReceipt, error)
Create stores content only when virtualPath is absent. An identical retry, including any supplied provenance, returns the existing node and version; any different existing authority returns ErrContentConflict without appending history.
func (*Vault) EmptyTrash ¶ added in v0.10.0
func (v *Vault) EmptyTrash( ctx context.Context, opts TrashEmptyOptions, ) (TrashEmptyReport, error)
EmptyTrash previews or hard-deletes one finite batch of eligible trash roots. Subtrees cascade with their selected root; candidate and deletion counts therefore describe roots, not every descendant row.
func (*Vault) GarbageCollect ¶ added in v0.10.0
GarbageCollect previews or removes one bounded canonical-hash page of unreachable catalog authority. The daemon separately reconciles physical orphan files for its legacy full-maintenance endpoint.
func (*Vault) ID ¶
ID reports the stable logical vault identity preserved by metadata export, backup, and restore. It is independent of the vault's filesystem root.
func (*Vault) LooseBacklog ¶ added in v0.10.0
func (v *Vault) LooseBacklog(ctx context.Context) (LooseBacklog, error)
LooseBacklog reports indexed loose content eligible for explicit packing.
func (*Vault) MovePath ¶ added in v0.10.0
func (v *Vault) MovePath( ctx context.Context, from, to string, opts RevisionOptions, ) (MutationReceipt, error)
MovePath renames or reparents one live path and returns its canonical new path. A positive IfRevision must match the source node exactly.
func (*Vault) OpenContent ¶
OpenContent opens the current catalog-authorized bytes for a live file. The reader holds a vault lease until Close; bytes are authoritative only after terminal io.EOF or a successful Verify.
func (*Vault) OpenVersionContent ¶
OpenVersionContent opens the catalog-authorized bytes for one immutable content version. The reader holds a vault lease and uses the same verified read contract as OpenContent.
func (*Vault) Pack ¶
func (v *Vault) Pack(ctx context.Context, opts PackOptions) (PackReport, error)
Pack explicitly moves authorized loose content into managed immutable packs. It also performs the same reconciliation and repair pass as the standalone storage pack operation. Ordinary Put calls remain loose until Pack is called.
func (*Vault) Provenance ¶ added in v0.11.0
func (v *Vault) Provenance( ctx context.Context, nodeID int64, opts ProvenanceOptions, ) (ProvenancePage, error)
Provenance returns one bounded page of immutable origin facts for a file. The node, live path, count, and page come from one metadata snapshot. Path is empty when nodeID is in trash.
func (*Vault) Put ¶
func (v *Vault) Put( ctx context.Context, virtualPath string, content io.Reader, opts PutOptions, ) (PutReceipt, error)
Put stores a reader at an absolute virtual file path. Missing parent directories are created. An unchanged retry converges on the current version; changed bytes create a new immutable version on the same node.
func (*Vault) Repack ¶ added in v0.10.0
func (v *Vault) Repack(ctx context.Context, opts RepackOptions) (RepackReport, error)
Repack retires dead packs and rewrites eligible sparse packs within one bounded pass while preserving Kit's soft raw-byte budget.
func (*Vault) RepairContent ¶ added in v0.10.0
func (v *Vault) RepairContent( ctx context.Context, identity ContentIdentity, trusted io.Reader, ) (RepairReceipt, error)
RepairContent replaces the physical bytes for one existing content identity after fully verifying trusted against its required SHA-256 and size. All nodes and historical versions keep referencing the same immutable identity.
func (*Vault) Restore ¶ added in v0.10.0
func (v *Vault) Restore( ctx context.Context, nodeID int64, opts RevisionOptions, ) (MutationReceipt, error)
Restore returns a trash root to its recorded origin, or to the canonical conflict-suffixed path selected by the store. A positive IfRevision must match the trashed node exactly.
func (*Vault) SQLiteDriver ¶
SQLiteDriver reports the adapter selected for this vault.
func (*Vault) TrashPath ¶ added in v0.10.0
func (v *Vault) TrashPath( ctx context.Context, path string, opts RevisionOptions, ) (MutationReceipt, error)
TrashPath moves one live path and its subtree to trash, returning the canonical pre-trash path. A positive IfRevision must match the root node.
func (*Vault) Verify ¶ added in v0.10.0
func (v *Vault) Verify(ctx context.Context, opts VerifyOptions) (VerifyReport, error)
Verify validates one bounded canonical-hash page of catalog-authorized content. Whole-catalog metadata validation remains daemon-only.
func (*Vault) Versions ¶
func (v *Vault) Versions( ctx context.Context, nodeID int64, opts VersionsOptions, ) (VersionsPage, error)
type VerifiedReadCloser ¶
type VerifiedReadCloser interface {
io.ReadCloser
Verify() error
}
VerifiedReadCloser is a bounded-memory content reader. A caller must reach terminal io.EOF or call Verify successfully before treating bytes as valid; an early Close reports incomplete verification and never drains implicitly.
type VerifyOptions ¶ added in v0.10.0
type VerifyOptions struct{ Budget WorkBudget }
type VerifyProblem ¶ added in v0.10.0
type VerifyReport ¶ added in v0.10.0
type VerifyReport struct {
MaintenanceProgress
OK int `json:"ok"`
Problems []VerifyProblem `json:"problems,omitempty"`
MetadataProblems []string `json:"metadata_problems,omitempty"`
}
VerifyReport summarizes one bounded content verification pass. The metadata field remains for compatibility with the daemon's full verification report.
type VersionContent ¶
type VersionContent struct {
Version ContentVersion
Reader VerifiedReadCloser
}
VersionContent binds a verified byte stream to one immutable content version.
type VersionsOptions ¶
type VersionsPage ¶
type VersionsPage struct {
Items []ContentVersion `json:"items"`
Total int `json:"total"`
Limit int `json:"limit"`
Offset int `json:"offset"`
}
type WalkEntry ¶ added in v0.10.0
WalkEntry is one node and its canonical path in the traversal snapshot.
type WalkOptions ¶ added in v0.10.0
WalkOptions controls one stable snapshot traversal.
type Walker ¶ added in v0.10.0
type Walker struct {
// contains filtered or unexported fields
}
Walker returns bounded pages from one stable tree snapshot until closed.
type WorkBudget ¶ added in v0.10.0
WorkBudget bounds one embedded maintenance pass. MaxObjects zero uses DefaultMaintenanceMaxObjects and values above MaxMaintenanceObjects are rejected. MaxBytes zero is unlimited; a positive byte limit is soft, so one selected object may carry the pass over the limit.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
docbank
command
|
|
|
Package document converts provider-neutral source evidence into deterministic normalized units, headings, spans, and chunks.
|
Package document converts provider-neutral source evidence into deterministic normalized units, headings, spans, and chunks. |
|
embedding
Package embedding prepares deterministic, provider-neutral document inputs for text embedding and optional pre-embedding distillation.
|
Package embedding prepares deterministic, provider-neutral document inputs for text embedding and optional pre-embedding distillation. |
|
embedding/eval
Package eval evaluates document retrieval recipes against versioned public or synthetic corpora with graded relevance judgments.
|
Package eval evaluates document retrieval recipes against versioned public or synthetic corpora with graded relevance judgments. |
|
internal/compattest
Package compattest loads the frozen cross-repository compatibility evidence.
|
Package compattest loads the frozen cross-repository compatibility evidence. |
|
internal/manifestjson
Package manifestjson provides strict JSON checks shared by provider capability manifests and provider responses.
|
Package manifestjson provides strict JSON checks shared by provider capability manifests and provider responses. |
|
media
Package media detects still images, animated images, and video from bytes and evaluates them against a bounded eligibility policy.
|
Package media detects still images, animated images, and video from bytes and evaluates them against a bounded eligibility policy. |
|
media/mediatest
Package mediatest builds small deterministic synthetic media containers for tests.
|
Package mediatest builds small deterministic synthetic media containers for tests. |
|
mistral
Package mistral provides bounded, stateless document extraction through the Mistral OCR API.
|
Package mistral provides bounded, stateless document extraction through the Mistral OCR API. |
|
mistral/internal/probecontract
Package probecontract owns the private serialized request identity shared by production probing and consumer test support.
|
Package probecontract owns the private serialized request identity shared by production probing and consumer test support. |
|
mistral/internal/testfixture
Package testfixture contains deterministic synthetic document bytes shared by Docbank's tests and its consumer test-support package.
|
Package testfixture contains deterministic synthetic document bytes shared by Docbank's tests and its consumer test-support package. |
|
mistral/mistraltest
Package mistraltest provides deterministic synthetic documents and capability evidence for applications that test Mistral integrations.
|
Package mistraltest provides deterministic synthetic documents and capability evidence for applications that test Mistral integrations. |
|
voyage
Package voyage provides bounded, stateless multimodal embedding of images and video through the Voyage AI API.
|
Package voyage provides bounded, stateless multimodal embedding of images and video through the Voyage AI API. |
|
voyage/internal/probecontract
Package probecontract pins the request identity shared by the Voyage capability probe and synthetic test manifests.
|
Package probecontract pins the request identity shared by the Voyage capability probe and synthetic test manifests. |
|
voyage/voyagetest
Package voyagetest provides synthetic capability evidence for applications that test Voyage integrations.
|
Package voyagetest provides synthetic capability evidence for applications that test Voyage integrations. |
|
internal
|
|
|
audit
Package audit implements Docbank's internal audited-history authority.
|
Package audit implements Docbank's internal audited-history authority. |
|
backupapp
Package backupapp adapts docbank's logical schema and mixed blob store to Kit's application-neutral backup engine.
|
Package backupapp adapts docbank's logical schema and mixed blob store to Kit's application-neutral backup engine. |
|
blob
Package blob adapts Kit's mixed loose-and-packed content-addressed store to docbank's existing ingest, API, GC, and verification interfaces.
|
Package blob adapts Kit's mixed loose-and-packed content-addressed store to docbank's existing ingest, API, GC, and verification interfaces. |
|
client
Package client is the typed HTTP client for the docbank daemon.
|
Package client is the typed HTTP client for the docbank daemon. |
|
config
Package config loads the optional $DOCBANK_HOME/config.toml.
|
Package config loads the optional $DOCBANK_HOME/config.toml. |
|
daemonauth
Package daemonauth implements proof that a discovered loopback endpoint owns the private runtime record without sending either runtime secret to it.
|
Package daemonauth implements proof that a discovered loopback endpoint owns the private runtime record without sending either runtime secret to it. |
|
daemonlife
Package daemonlife defines lifecycle budgets shared by the daemon and the clients that wait for it to stop.
|
Package daemonlife defines lifecycle budgets shared by the daemon and the clients that wait for it to stop. |
|
extract
Package extract runs bounded, daemon-owned document text extraction.
|
Package extract runs bounded, daemon-owned document text extraction. |
|
home
Package home resolves the docbank data directory layout.
|
Package home resolves the docbank data directory layout. |
|
ingest
Package ingest implements the single import pipeline shared by all entry points: hash → durable blob write → one metadata transaction per file.
|
Package ingest implements the single import pipeline shared by all entry points: hash → durable blob write → one metadata transaction per file. |
|
jobs
Package jobs supervises daemon-owned background work.
|
Package jobs supervises daemon-owned background work. |
|
maintenance
Package maintenance contains storage lifecycle operations shared by the embedded Vault and daemon HTTP adapters.
|
Package maintenance contains storage lifecycle operations shared by the embedded Vault and daemon HTTP adapters. |
|
store
Package store implements the SQLite-backed virtual tree.
|
Package store implements the SQLite-backed virtual tree. |
|
storenamespace
Package storenamespace canonicalizes deployment storage namespaces before Docbank compares or grants authority to them.
|
Package storenamespace canonicalizes deployment storage namespaces before Docbank compares or grants authority to them. |
|
tui
Package tui provides Docbank's daemon-backed terminal interface.
|
Package tui provides Docbank's daemon-backed terminal interface. |
|
update
Package update wraps kit/selfupdate with docbank's release identity and daemon-aware install: stop the daemon, swap the binary, restart it.
|
Package update wraps kit/selfupdate with docbank's release identity and daemon-aware install: stop the daemon, swap the binary, restart it. |
|
version
Package version carries the build-stamped identity shared by the CLI, the daemon runtime record, the OpenAPI document, and self-update.
|
Package version carries the build-stamped identity shared by the CLI, the daemon runtime record, the OpenAPI document, and self-update. |
|
web
Package web owns the frontend assets embedded in the Docbank binary.
|
Package web owns the frontend assets embedded in the Docbank binary. |
|
winsecurity
Package winsecurity contains the Windows-only primitives that must operate on already-open handles rather than pathnames.
|
Package winsecurity contains the Windows-only primitives that must operate on already-open handles rather than pathnames. |
|
Package sqlite defines the database-driver boundary used by embedded and standalone Docbank vaults.
|
Package sqlite defines the database-driver boundary used by embedded and standalone Docbank vaults. |
|
mattn
Package mattn adapts github.com/mattn/go-sqlite3 to Docbank.
|
Package mattn adapts github.com/mattn/go-sqlite3 to Docbank. |
|
modernc
Package modernc adapts modernc.org/sqlite to Docbank without CGO.
|
Package modernc adapts modernc.org/sqlite to Docbank without CGO. |
