Help us shape the future of Go! Take the 2026 Go Developer Survey

kernel

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 12, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthorityRules

type AuthorityRules struct {
	Allow map[contract.ActorID][]contract.ResourceKind
}

AuthorityRules.Enforce takes NO Version (authorization is not concurrency, Invariant #11).

func (AuthorityRules) Enforce

func (r AuthorityRules) Enforce(actor contract.ActorID, kind contract.ResourceKind) error

type Kernel

type Kernel struct {
	// contains filtered or unexported fields
}

func NewKernel

func NewKernel(s *store.Store, g SchemaGuard, r AuthorityRules) *Kernel

func (*Kernel) Apply

Apply is the ONLY canonical writer (Invariant #2). check+write are one atomic txn (Invariant #3); multi-resource is all-or-nothing (Invariant #5). It persists exactly one terminal decision (Invariant #7): the accept is written INSIDE the writes txn (crash-safe); non-accepts are written in their own txn.

func (*Kernel) Store

func (k *Kernel) Store() *store.Store

type SchemaGuard

type SchemaGuard struct {
	Required map[contract.ResourceKind][]string
}

func DefaultSchemaGuard

func DefaultSchemaGuard() SchemaGuard

func SchemaGuardWith

func SchemaGuardWith(extra map[contract.ResourceKind][]string) SchemaGuard

SchemaGuardWith returns the governance DefaultSchemaGuard extended with the given user-kind required fields. The live runtime gets these from the assembler (each enabled capability's declared required header); SchemaGuardWith is for callers that build a kernel WITHOUT assembling a catalog (tests using a canonical user kind, and any hand-built config) — they name the kinds they need rather than relying on a privileged default.

func (SchemaGuard) Validate

func (g SchemaGuard) Validate(kind contract.ResourceKind, fields map[string]any) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL