outagesim

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecuteServiceCmd

func ExecuteServiceCmd(status string) error

ExecuteServiceCmd will execute the specified service-related command for the Tendermint service on this machine. This requires the `outage-sim-server` process to be running as root, and requires the OS to have a `service` command (such as CentOS, Ubuntu or Debian).

func IsTendermintRunning

func IsTendermintRunning() bool

IsTendermintRunning attempts to check whether there is a process called "tendermint" currently running on the system.

func MakeOutageEndpointHandler

func MakeOutageEndpointHandler(
	username, passwordHash string,
	isTendermintRunningFn func() bool,
	executeServiceCmdFn func(string) error,
) func(http.ResponseWriter, *http.Request)

MakeOutageEndpointHandler creates an HTTP handler for dealing with the incoming up/down requests to bring the Tendermint service up or down. Sending a POST request to the server with either "up" or "down" in the body of the request will attempt to bring the Tendermint service up or down accordingly.

Types

This section is empty.

Jump to

Keyboard shortcuts

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