Documentation
¶
Overview ¶
Package fakeengine is a lightweight engine for operator tests (0004 §9): it speaks the bundle protocol, verifies each bundle's signature and acknowledges it, without inspecting any traffic. Many fit in one test.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine struct {
ID string
// Addr is the operator's distribution server, host:port.
Addr string
// TLS verifies the operator's certificate.
TLS *tls.Config
// Token is the ServiceAccount token sent as a bearer token.
Token string
// PublicKeys verify bundles, chosen by their key ID; SetPublicKeys
// changes them while the engine runs, as a reloaded key file does.
PublicKeys []ed25519.PublicKey
// Reject, if set, decides whether to refuse a bundle (Nack).
Reject func(*bundlev1.Bundle) error
// Heartbeat is the interval of heartbeats; 0 means 1s.
Heartbeat time.Duration
// OnApply, if set, is called with each bundle the engine applies,
// before its Ack.
OnApply func(*bundlev1.Bundle)
// KeepVersionOnly keeps only the version of the applied bundle, not
// its policies: hundreds of engines with a large bundle each would
// take gigabytes (the scale test, operator/test/scale).
KeepVersionOnly bool
// contains filtered or unexported fields
}
Engine is a fake engine.
func (*Engine) SetPublicKeys ¶ added in v0.1.1
SetPublicKeys replaces the trusted keys; heartbeats report them.
func (*Engine) TrustedKeys ¶ added in v0.1.1
TrustedKeys returns the IDs of the trusted keys.