Documentation
¶
Overview ¶
Package networkdirectory owns signed network snapshots, bounded refresh and durable rollback protection. It never imports built-in infrastructure.
Index ¶
Constants ¶
Variables ¶
Functions ¶
This section is empty.
Types ¶
type BlockingReason ¶
type BlockingReason string
const ( Unprovisioned BlockingReason = "unprovisioned" InvalidConfiguration BlockingReason = "invalid_network_configuration" TrustStateUnreadable BlockingReason = "trust_state_unreadable" TrustStateInvalid BlockingReason = "trust_state_invalid" TrustStateUnwritable BlockingReason = "trust_state_unwritable" )
type Cache ¶
type Cache interface {
Load(context.Context) (Record, error)
Update(context.Context, func(Record) (Record, error)) (Record, error)
}
Cache commits the signed snapshot and rollback cursor together. Update's callback must run under the same lock as the read, including across processes.
type Directory ¶
type Directory struct {
// contains filtered or unexported fields
}
func (*Directory) Refresh ¶
Refresh coalesces user retries, unknown-alias resolution and periodic refresh. Caller cancellation stops waiting, not an update another task also needs.
func (*Directory) RetryAt ¶
RetryAt exposes only failure backoff. Successful periodic maintenance must never postpone an explicit retry or unknown-alias refresh.
func (*Directory) Unavailability ¶
func (directory *Directory) Unavailability() *UnavailableError
Unavailability ignores maintenance failures while a trusted snapshot is usable.
type FileCache ¶
type FileCache struct {
// contains filtered or unexported fields
}
func NewFileCache ¶
Separate trust histories by network, including builds sharing the same user settings. A key rotation within a network must still respect its previous rollback cursor.
type MemoryCache ¶
type MemoryCache struct {
// contains filtered or unexported fields
}
type Record ¶
type Record struct {
Cursor nodedirectory.Cursor `json:"cursor"`
Envelope []byte `json:"envelope"`
Aliases map[string]string `json:"aliases"`
}
type UnavailableError ¶
type UnavailableError struct {
}
UnavailableError carries the owner's recovery decision, independently of the diagnostic cause. RetryAt is the earliest permitted refresh, not a promise of connectivity or an instruction for applications to start another poller.
func (*UnavailableError) Error ¶
func (err *UnavailableError) Error() string
func (*UnavailableError) Is ¶
func (err *UnavailableError) Is(target error) bool
func (*UnavailableError) Unwrap ¶
func (err *UnavailableError) Unwrap() error