wrapper

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2025 License: MIT Imports: 4 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WrapperManager

type WrapperManager struct {
	ManagedNodes []string
	Port         int
	Client       *http.Client
}

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.

func (*WrapperManager) Stop

func (wm *WrapperManager) Stop(ctx context.Context, node string) error

Stops the binary on the specified node.

func (*WrapperManager) StopAll

func (wm *WrapperManager) StopAll(ctx context.Context) map[string]error

Stops the binary on all managed nodes.

Jump to

Keyboard shortcuts

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