Documentation
¶
Overview ¶
Package schema holds the typed shapes that the cmd/* tools share. Manifest parsing lives here so cmd/gencreds and cmd/gentopology read the same struct definitions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodePathSegment ¶
EncodePathSegment percent-encodes a single URL path segment for inclusion in a NATS subject. Every byte outside [A-Za-z0-9-] becomes %XX (uppercase hex). Mirrors connector.escapePathPart. Wildcard sentinels are the caller's responsibility; this helper assumes a literal segment.
func FlattenHostname ¶
FlattenHostname encodes a hostname for use as a single NATS subject segment. '.' becomes '_'; characters outside [A-Za-z0-9_-] are percent-encoded as %XX (uppercase hex). Mirrors connector.escapeHostname; output must be byte- identical so emitted ACL subjects match what the runtime publishes.
func ReverseHostname ¶
ReverseHostname reverses dot-separated segments: www.example.com -> com.example.www.
Types ¶
type Downstream ¶
type Downstream struct {
Hostname string `yaml:"hostname"`
Package string `yaml:"package,omitempty"`
}
Downstream is a service this one calls into via its *api Client. Only the hostname and package are recorded - the per-call endpoint set (route, method, hostname overrides) is derived from source by gencreds at deploy time, not stored in the manifest. This keeps callers' manifests stable across callee Def renames.
type EventSub ¶
type EventSub struct {
Package string `yaml:"package"`
}
EventSub captures the source of an inbound event subscription. The event name is the YAML map key (e.g. "OnOrderCreated"). The resolved hostname/route/method are intentionally omitted - they're derived from source by gencreds at deploy time.
type General ¶
type General struct {
Name string `yaml:"name"`
Hostname string `yaml:"hostname"`
Package string `yaml:"package"`
}
General is the manifest's identity block.
type Manifest ¶
type Manifest struct {
General General `yaml:"general"`
Webs map[string]Route `yaml:"webs"`
Functions map[string]Route `yaml:"functions"`
Tasks map[string]Route `yaml:"tasks"`
Workflows map[string]Route `yaml:"workflows"`
OutboundEvents map[string]Route `yaml:"outboundEvents"`
InboundEvents map[string]EventSub `yaml:"inboundEvents"`
Downstream []Downstream `yaml:"downstream"`
}
Manifest is the subset of manifest.yaml that the cmd/* tools depend on. Fields not used by any tool are intentionally omitted; YAML unmarshal silently ignores unknown keys, so adding fields here is non-breaking.
func ReadManifest ¶
ReadManifest parses manifest.yaml from the given path.
func (*Manifest) ExposedRoutes ¶
ExposedRoutes returns all caller-reachable routes (webs + functions + tasks + workflows).