Documentation
¶
Overview ¶
Package manifest reads and writes the .awf/awf.lock and detects drift between rendered output and its sources.
Index ¶
- Variables
- func Hash(b []byte) string
- func LoadSchemaOptional(path string) (int, bool, error)
- func NormalizeSemver(s string) (string, bool)
- func ValidateLive(l *Lock, floor, current int) error
- func WriteFileAtomic(path string, data []byte) error
- func WriteFileAtomicMode(path string, data []byte, mode os.FileMode) error
- type AuthorityState
- type Drift
- type Entry
- type LiveSourceError
- type Lock
- func Load(path string) (*Lock, error)
- func LoadLive(path string, floor, current int) (*Lock, error)
- func LoadLiveOptional(path string, floor, current int) (*Lock, bool, error)
- func LoadOptional(path string) (*Lock, bool, error)
- func Parse(b []byte) (*Lock, error)
- func ParseLive(b []byte, floor, current int) (*Lock, error)
- type PartialAuthorityError
Constants ¶
This section is empty.
Variables ¶
var ErrUnsupportedLiveSource = errors.New("unsupported live source")
ErrUnsupportedLiveSource identifies authority that cannot be dispatched by a live operation.
Functions ¶
func LoadSchemaOptional ¶ added in v0.40.0
LoadSchemaOptional reads only the schema stamp. Migration classification uses it before deciding whether current authority decoding is permitted.
func NormalizeSemver ¶ added in v0.22.0
func ValidateLive ¶ added in v0.40.0
ValidateLive accepts only authority a user-invoked operation may dispatch on.
func WriteFileAtomic ¶ added in v0.11.0
WriteFileAtomic writes data through a same-directory temporary file and rename, so a failed write never leaves a truncated destination.
func WriteFileAtomicMode ¶ added in v0.30.0
WriteFileAtomicMode is WriteFileAtomic with an explicit final mode, used when a restored file's recorded permissions must survive the replacement. touches-state: config/migrations-and-locks:lock-atomic-save - atomic temp-file+rename write site; proof in manifest_test.go
Types ¶
type AuthorityState ¶ added in v0.22.0
type AuthorityState uint8
AuthorityState identifies the sole supported permanent lock authority.
const AuthorityPermanent AuthorityState = 1
type Entry ¶
type Entry struct {
TemplateID string `json:"templateId"`
TemplateHash string `json:"templateHash"`
ConfigHash string `json:"configHash"`
OutputHash string `json:"outputHash"`
// RegenChecked marks an entry whose drift is checked by regeneration rather
// than by the frozen OutputHash: generated indexes and navigation plus
// in-place-editable files. Omitted when false so a plain entry's
// serialization is unchanged.
RegenChecked bool `json:"regenChecked,omitempty"`
}
type LiveSourceError ¶ added in v0.40.0
type LiveSourceError struct{ Schema, Floor, Current int }
LiveSourceError carries live compatibility facts without recovery presentation.
func (*LiveSourceError) Error ¶ added in v0.40.0
func (e *LiveSourceError) Error() string
func (*LiveSourceError) Is ¶ added in v0.40.0
func (e *LiveSourceError) Is(target error) bool
type Lock ¶
type Lock struct {
AWFVersion string `json:"awfVersion"`
SchemaVersion int `json:"schemaVersion"`
Files map[string]Entry `json:"files"`
InitializedWithVersion string `json:"initializedWithVersion,omitempty"`
}
func LoadLive ¶ added in v0.40.0
LoadLive reads a lock only after its schema stamp passes the live-source boundary, so unsupported bytes never reach current authority interpretation.
func LoadLiveOptional ¶ added in v0.40.0
LoadLiveOptional is the optional-file form of LoadLive.
func Parse ¶ added in v0.22.0
Parse rejects retired routing keys at every schema. Historical decoding is owned by audit rather than the live manifest model.
func (*Lock) AuthorityState ¶ added in v0.22.0
func (l *Lock) AuthorityState() (AuthorityState, error)
AuthorityState validates permanent lock authority. Older adopters may omit initialization provenance and remain valid permanent authority.
type PartialAuthorityError ¶ added in v0.40.0
type PartialAuthorityError struct{ Config, Lock bool }
PartialAuthorityError identifies an incomplete control pair without prescribing recovery.
func (*PartialAuthorityError) Error ¶ added in v0.40.0
func (e *PartialAuthorityError) Error() string