Documentation
¶
Overview ¶
Package wiring checks a wiring directory (BACKPLANE_WIRING_DIR: bindings and rules as YAML) against the declarations of the services it wires, as backplane does when it keeps the directory in force. A test of an installation runs it, so a binding backplane would reject fails CI instead of the stand:
violations, err := wiring.Check("deployments/wiring", []*backplanev1.Manifest{
coreHarness.Manifest(), relayHarness.Manifest(),
})
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*settings)
Option configures Check.
func DirectRuntime ¶
func DirectRuntime() Option
DirectRuntime checks the definitions that name no runtime as the direct runtime's: an installation whose BACKPLANE_WIRING_RUNTIME resolves to direct. Without it they are checked as Temporal's.
type Violation ¶
type Violation struct {
// File is the YAML file, relative to the directory.
File string
// Kind is "binding" or "rule"; Name is the binding's hook or the rule's name.
Kind, Name string
// Path is the JSON Pointer of the place in the definition
// ("/steps/send/input/to"); empty for the whole definition.
Path string
// Code is the stable code of the violation (backplane's console shows the same).
Code string
Message string
}
Violation is what backplane refuses in one binding or rule.
func Check ¶
Check validates every binding and rule of dir against manifests, the declarations of every service the wiring names (a backplanetest Harness's Manifest). A service missing from manifests is a violation, as it is a binding waiting for its service on a stand. The error is a directory that does not read: a YAML or unknown-field error, a duplicate.