fakeengine

package
v0.1.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2026 License: Apache-2.0 Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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
	// PublicKey verifies bundles.
	PublicKey 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
	// contains filtered or unexported fields
}

Engine is a fake engine.

func (*Engine) Applied

func (e *Engine) Applied() *bundlev1.Bundle

Applied returns the bundle the engine runs, nil before the first.

func (*Engine) Err

func (e *Engine) Err() error

Err returns why the stream ended, once Run returned.

func (*Engine) Run

func (e *Engine) Run(ctx context.Context) error

Run connects and serves one stream until ctx ends or the stream fails.

Jump to

Keyboard shortcuts

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