Documentation
¶
Overview ¶
Package command persists command identity and receiver-side fencing before dispatch. It retains receipts and watermarks after resource deletion.
Index ¶
- Constants
- func CopyContext(parent, source context.Context) context.Context
- func WithContext(ctx context.Context, envelope Envelope) context.Context
- type Authority
- func (a *Authority) Activation(phase string) (*model.ActivationReceipt, error)
- func (a *Authority) Active(phase string) bool
- func (a *Authority) CheckActivation(request model.ActivationRequest, key, receiver string) (*model.ActivationReceipt, error)
- func (a *Authority) CommitActivation(receipt model.ActivationReceipt) error
- func (a *Authority) CommitFence(receipt model.FencingReceipt) error
- func (a *Authority) FenceReceipt() (*model.FencingReceipt, error)
- func (a *Authority) RequireActive(phase string) error
- func (a *Authority) State() (AuthorityState, error)
- type AuthorityState
- type EnrollmentStore
- func (s EnrollmentStore) Check(token string, env Envelope, r model.EnrollmentRequest) error
- func (s EnrollmentStore) Claim(token string, env Envelope, r model.EnrollmentRequest) error
- func (s EnrollmentStore) Complete(token string, env Envelope, r model.EnrollmentRequest, ...) error
- func (s EnrollmentStore) Issue(authority string, epoch uint64, key string, r model.EnrollmentRequest) (string, error)
- func (s EnrollmentStore) Receipt(token string, env Envelope, r model.EnrollmentRequest) (*model.EnrollmentReceipt, error)
- func (s EnrollmentStore) Validate() error
- type Envelope
- type Journal
- func (s *Journal) CheckCurrentLocked(ctx context.Context) error
- func (s *Journal) ControlHTTP(w http.ResponseWriter, r *http.Request)
- func (s *Journal) ControlReport() (model.ControlReport, error)
- func (s *Journal) ControlSubject() (string, error)
- func (s *Journal) IdleExcept(subject string) bool
- func (s *Journal) MutationsAllowed() bool
- func (s *Journal) SetAuthority(path string) error
- func (s *Journal) Wrap(next http.Handler, supports func(*http.Request) bool, ...) http.Handler
Constants ¶
const EpochSequenceBits = 40
const MaxEnrollmentGrants = 256
const MaxEpoch = (1 << 23) - 1
const Schema = `` /* 296-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Authority ¶
type Authority struct {
// contains filtered or unexported fields
}
func OpenAuthority ¶
func (*Authority) Activation ¶
func (a *Authority) Activation(phase string) (*model.ActivationReceipt, error)
func (*Authority) CheckActivation ¶
func (a *Authority) CheckActivation(request model.ActivationRequest, key, receiver string) (*model.ActivationReceipt, error)
CheckActivation validates a monotone chain. The host handler must separately recompute its own complete physical inventory while frozen before committing reads or mutations. This journal never accepts an operator boolean proof.
func (*Authority) CommitActivation ¶
func (a *Authority) CommitActivation(receipt model.ActivationReceipt) error
func (*Authority) CommitFence ¶
func (a *Authority) CommitFence(receipt model.FencingReceipt) error
func (*Authority) FenceReceipt ¶
func (a *Authority) FenceReceipt() (*model.FencingReceipt, error)
func (*Authority) RequireActive ¶
func (*Authority) State ¶
func (a *Authority) State() (AuthorityState, error)
type AuthorityState ¶
type AuthorityState struct {
Version int `json:"version"`
ID string `json:"authority"`
Epoch uint64 `json:"epoch"`
Phase string `json:"phase"`
Key string `json:"key"`
}
AuthorityState lives outside the SQLite restore scope. Root operators advance it before recovery; a restored database cannot lower this receiver's epoch. Epochs alone are not physical host fencing or permission to resume work.
type EnrollmentStore ¶
type EnrollmentStore struct{ Directory string }
EnrollmentStore is independent of SQLite restore. Its generated directory identity, separately anchored count and paired claim records prevent missing metadata from manufacturing fresh enrollment permission (INV-03/04/05/14).
func CreateEnrollmentStore ¶
func CreateEnrollmentStore(parent string, key string) (EnrollmentStore, error)
CreateEnrollmentStore publishes a fresh generated directory below an existing private parent. It cannot recreate a deleted configured identity by name.
func (EnrollmentStore) Check ¶
func (s EnrollmentStore) Check(token string, env Envelope, r model.EnrollmentRequest) error
func (EnrollmentStore) Claim ¶
func (s EnrollmentStore) Claim(token string, env Envelope, r model.EnrollmentRequest) error
Claim commits before membership mutation. Reconciliation may reuse only the exact original command identity; another key never reuses this grant.
func (EnrollmentStore) Complete ¶
func (s EnrollmentStore) Complete(token string, env Envelope, r model.EnrollmentRequest, receipt model.EnrollmentReceipt) error
func (EnrollmentStore) Issue ¶
func (s EnrollmentStore) Issue(authority string, epoch uint64, key string, r model.EnrollmentRequest) (string, error)
Issue binds a random token to one authority epoch and exact reviewed receiver. Only its private file contains the token value; records retain its digest. Exact issuance replay returns the original value, never new authority.
func (EnrollmentStore) Receipt ¶
func (s EnrollmentStore) Receipt(token string, env Envelope, r model.EnrollmentRequest) (*model.EnrollmentReceipt, error)
Receipt replays the independently retained original business result even if the SQLite command-cache publication was lost. It does not probe membership.
func (EnrollmentStore) Validate ¶
func (s EnrollmentStore) Validate() error
type Envelope ¶
type Envelope struct {
Authority string `json:"authority,omitempty"`
Epoch uint64 `json:"epoch,omitempty"`
Subject string `json:"subject"`
Group string `json:"group,omitempty"`
Generation uint64 `json:"generation"`
Token uint64 `json:"token"`
Key string `json:"key"`
Fingerprint string `json:"fingerprint"`
}
type Journal ¶
type Journal struct {
Authority *Authority
Conn *sql.Conn
Mu *sync.Mutex
// contains filtered or unexported fields
}
func (*Journal) CheckCurrentLocked ¶
CheckCurrentLocked revalidates admitted authority after waiting for the host mutation lock. The caller must hold Journal.Mu through its effect (INV-04).
func (*Journal) ControlHTTP ¶
func (s *Journal) ControlHTTP(w http.ResponseWriter, r *http.Request)
func (*Journal) ControlReport ¶
func (s *Journal) ControlReport() (model.ControlReport, error)