Documentation
¶
Overview ¶
Package wrapper provides a WrapperManager to control the lifecycle of binaries on multiple nodes via HTTP requests. It is intended for use in testing harnesses to start, stop, reset, and shutdown nodes, as well as to inject failures.
Index ¶
- type WrapperManager
- func (wm *WrapperManager) Ready(ctx context.Context, node string) error
- func (wm *WrapperManager) ReadyAll(ctx context.Context) map[string]error
- func (wm *WrapperManager) Reset(ctx context.Context, node string) error
- func (wm *WrapperManager) ResetAll(ctx context.Context) map[string]error
- func (wm *WrapperManager) Shutdown(ctx context.Context, node string) error
- func (wm *WrapperManager) ShutdownAll(ctx context.Context) map[string]error
- func (wm *WrapperManager) Start(ctx context.Context, node string) error
- func (wm *WrapperManager) StartAll(ctx context.Context) map[string]error
- func (wm *WrapperManager) Stop(ctx context.Context, node string) error
- func (wm *WrapperManager) StopAll(ctx context.Context) map[string]error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type WrapperManager ¶
WrapperManager manages the lifecycle of binaries on multiple nodes via HTTP requests. Intended for testing harness to control nodes and inject failures.
func NewWrapperManager ¶
func NewWrapperManager(port int, nodes ...string) *WrapperManager
NewWrapperManager creates a new WrapperManager for the specified nodes and port.
func (*WrapperManager) Ready ¶ added in v0.0.6
func (wm *WrapperManager) Ready(ctx context.Context, node string) error
Checks whether the binary on the specified node is ready. This assumes the wrapper exposes a /ready endpoint that returns 2xx when ready.
func (*WrapperManager) ReadyAll ¶ added in v0.0.6
func (wm *WrapperManager) ReadyAll(ctx context.Context) map[string]error
Checks whether the binary on all managed nodes is ready. Returns a map from node alias to any error returned by the /ready endpoint.
func (*WrapperManager) Reset ¶
func (wm *WrapperManager) Reset(ctx context.Context, node string) error
Stops and then starts the binary on the specified node.
func (*WrapperManager) ResetAll ¶
func (wm *WrapperManager) ResetAll(ctx context.Context) map[string]error
Resets the binary on all managed nodes.
func (*WrapperManager) Shutdown ¶
func (wm *WrapperManager) Shutdown(ctx context.Context, node string) error
Completely shuts down the wrapper and the binary on the specified node.
func (*WrapperManager) ShutdownAll ¶
func (wm *WrapperManager) ShutdownAll(ctx context.Context) map[string]error
Shuts down the wrapper and binary on all managed nodes.
func (*WrapperManager) Start ¶
func (wm *WrapperManager) Start(ctx context.Context, node string) error
Starts the binary on the specified node.
func (*WrapperManager) StartAll ¶
func (wm *WrapperManager) StartAll(ctx context.Context) map[string]error
Starts the binary on all managed nodes.