Documentation
¶
Overview ¶
Package plugin provides the implementation-neutral protocol composition contract used by the root networking extension and its protocol subpackages.
Index ¶
- Variables
- func RegisterBindings(module *wago.ImportModuleBuilder, bindings []Binding)
- type Authority
- type Backend
- type BackendFamily
- type Binding
- type Host
- type Module
- func (m Module) ConfigureAuthority(target *policy.Config) error
- func (m Module) ConfigureBackend(family BackendFamily, target any) error
- func (m Module) Install(registry *wago.Registry, host Host)
- func (m Module) InstallBackend(family BackendFamily, base any) (nscore.Service, bool, error)
- func (m Module) WithAuthority(authority Authority) Module
- type ModuleKey
- type Set
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalidModule reports a protocol descriptor without a stable key or // registration callback. ErrInvalidModule = errors.New("wagonet: invalid protocol module") // ErrDuplicateModule reports a second registration for the same protocol. ErrDuplicateModule = errors.New("wagonet: protocol module already registered") // ErrFrozen reports registration attempted after Wago registration began. ErrFrozen = errors.New("wagonet: protocol registration is frozen") // ErrInvalidBackend reports an incomplete opaque backend contribution. ErrInvalidBackend = errors.New("wagonet: invalid protocol backend contribution") // ErrIncompatibleBackend reports a contribution for a different backend // family than the shared namespace selected by the root network. ErrIncompatibleBackend = errors.New("wagonet: incompatible protocol backend contribution") // ErrInvalidAuthority reports an unusable protocol authority contribution. ErrInvalidAuthority = errors.New("wagonet: invalid protocol authority contribution") )
Functions ¶
func RegisterBindings ¶
func RegisterBindings(module *wago.ImportModuleBuilder, bindings []Binding)
RegisterBindings installs a complete protocol binding table without exposing root-package implementation details to the protocol package.
Types ¶
type Authority ¶
type Authority struct {
// contains filtered or unexported fields
}
Authority is an immutable protocol-local policy grant contribution. The shared root composes every selected contribution with caller policy before compiling the one exact-instance policy. Ordinary deny rules therefore keep precedence over grants from any protocol or registration order.
func NewAuthority ¶
NewAuthority deep-copies one trusted protocol-local authority contribution.
type Backend ¶
type Backend struct {
// contains filtered or unexported fields
}
Backend is an opaque protocol-local contribution. Configure may add finite requirements to an unallocated shared backend config. Install attaches one service to the fully allocated exact-instance base namespace.
func NewBackend ¶
func NewBackend(family BackendFamily, configure func(any) error, install func(any) (nscore.Service, error)) Backend
NewBackend constructs one trusted backend contribution below this module's internal-package boundary.
type BackendFamily ¶
type BackendFamily string
BackendFamily identifies one shared backend assembly contract. Protocol modules selected on one network must contribute to the same family.
const ( // BackendLnetoV1 is the first shared static IPv4 backend family. BackendLnetoV1 BackendFamily = "lneto.static-ipv4.v1" )
type Binding ¶
type Binding struct {
Name string
Func wago.HostFunc
Params []wago.ValType
Results []wago.ValType
Capability wago.Capability
Docs string
}
Binding is one checked guest import contributed by a protocol module.
type Host ¶
type Host struct {
// contains filtered or unexported fields
}
Host is the protocol-neutral bridge from independently compiled guest bindings to the root network's exact-instance ownership manager. Its fields remain private so protocol modules cannot replace lifecycle ownership.
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
Module is an opaque, trusted protocol registration descriptor. Public protocol packages construct descriptors inside this module; ordinary users select them through tcp.Register, udp.Register, or dns.Register.
func NewModule ¶
NewModule constructs one protocol descriptor. It is intentionally available only below github.com/wago-org/net's internal-package boundary.
func (Module) ConfigureAuthority ¶
ConfigureAuthority composes this module's grants into the shared immutable policy input. Modules without authority are ignored.
func (Module) ConfigureBackend ¶
func (m Module) ConfigureBackend(family BackendFamily, target any) error
ConfigureBackend contributes protocol-local requirements before the shared backend is allocated. Modules without backend state are ignored.
func (Module) Install ¶
Install contributes this module's capability and imports to a Wago registry using the exact shared instance host owned by the root network.
func (Module) InstallBackend ¶
InstallBackend attaches one protocol-local service to an exact shared base. The bool is false only for modules that own no backend state.
func (Module) WithAuthority ¶
WithAuthority returns a descriptor carrying one protocol-local grant set. It is used by trusted binding/public protocol packages before registration.
type ModuleKey ¶
type ModuleKey string
ModuleKey is the stable identity used to reject duplicate protocol selection. The type lives behind Go's internal-package boundary so public protocol packages can share keys without expanding the root API.
const ( ModuleUDP ModuleKey = "udp" ModuleTCP ModuleKey = "tcp" ModuleDNS ModuleKey = "dns" ModuleICMPv4 ModuleKey = "icmpv4" ModuleNTP ModuleKey = "ntp" ModuleMDNS ModuleKey = "mdns" ModuleDHCPv4 ModuleKey = "dhcpv4" ModuleLinkLocal4 ModuleKey = "linklocal4" ModuleIPv6 ModuleKey = "ipv6" ModuleICMPv6 ModuleKey = "icmpv6" ModuleDHCPv6 ModuleKey = "dhcpv6" )