Documentation
¶
Overview ¶
Package promotion prepares content-only publication artifacts. It deliberately has no network client or apply endpoint: host authority, bundle fencing and restart-safe activation are separate mandatory publication gates.
Index ¶
Constants ¶
const SchemaVersion = 1
Variables ¶
var ErrBundle = errors.New("content bundle invalid or unsupported reference")
var ErrInvalid = errors.New("content snapshot invalid")
var ErrMapping = errors.New("content mapping invalid or ambiguous")
Functions ¶
func VerifyBundle ¶
func VerifyBundle(root string, manifest BundleManifest, pages []store.PageContent) error
VerifyBundle re-hashes the supplied directory, validates local references and rejects exact static route shadowing. Uploaded tenant media and admin paths remain unsupported; copying their URLs would leak review tenant identity.
Types ¶
type BundleFile ¶
type BundleManifest ¶
type BundleManifest struct {
Files []BundleFile `json:"files"`
Digest string `json:"digest"`
}
func InventoryBundle ¶
func InventoryBundle(root string) (BundleManifest, error)
InventoryBundle hashes exact regular files only. Call with an immutable version directory, not a current symlink. No file content is logged.
func (BundleManifest) Validate ¶
func (m BundleManifest) Validate() error
type DeleteSelection ¶
type Mapping ¶
type Plan ¶
type Plan struct {
Digest string `json:"digest"`
SnapshotDigest string `json:"snapshot_digest"`
BundleDigest string `json:"bundle_digest"`
BundleBaselineDigest string `json:"bundle_baseline_digest"`
Batch store.PageBatch `json:"batch"`
Diffs []Diff `json:"diffs"`
}
func DryRun ¶
func DryRun(s Snapshot, current store.PageSet, mappings []Mapping, deletes []DeleteSelection, targetBundle BundleManifest) (Plan, error)
DryRun requires an explicit mapping for every selected page. SuggestedMapping offers reviewable path matches, but never silently approves a rename/deletion. The caller must separately verify both on-disk bundles before publication.
func (Plan) ContentDigest ¶
type Snapshot ¶
type Snapshot struct {
Schema int `json:"schema"`
SourceSite string `json:"source_site"`
CreatedAt time.Time `json:"created_at"`
Pages []SnapshotPage `json:"pages"`
Bundle BundleManifest `json:"bundle"`
Digest string `json:"digest"`
}
func Decode ¶
Decode rejects unknown fields, duplicate JSON keys, trailing documents and oversize input. Errors are fixed; rejected keys/values are never returned.
func Export ¶
func Export(ctx context.Context, pages store.PageStore, sourceTenantID int64, sourceSite string, ids []int64, bundleRoot string, now time.Time) (Snapshot, error)
Export freezes selected rows. It reads the supplied authorized tenant scope; it never consults a domain, credential, tenant setting or editor membership.
func (Snapshot) ContentDigest ¶
type SnapshotPage ¶
type SnapshotPage struct {
Key string `json:"key"`
SourceID int64 `json:"source_id"`
SourceVersion int `json:"source_version"`
Content store.PageContent `json:"content"`
}