context

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2017 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	Mutex           *sync.Mutex
	HttpService     string
	EnableTLS       bool
	CertFile        string
	KeyFile         string
	UpstreamURL     *url.URL
	Out             io.Writer
	LogJSON         bool
	LogPrettyJSON   bool
	Echo            bool
	HttpCode        int
	Delay           int
	IgnoreTLSErrors bool
	FailureMode     FailureSimulation
}

Context type holds the desired execution profile for a command

func Instance

func Instance() *Context

func (*Context) Close

func (ctx *Context) Close()

Close the context

func (*Context) FailureSimulated

func (ctx *Context) FailureSimulated() bool

func (*Context) FailureSimulationEnabled

func (ctx *Context) FailureSimulationEnabled() bool

Determine if the failure simulation mode is enabled for this invocation

func (*Context) SimulateDelay

func (ctx *Context) SimulateDelay()

SimulateDelay will introduce a timed delay if specified

func (*Context) SimulateFailure

func (ctx *Context) SimulateFailure() int

SimulateFailure will run a failure simulation and return an HTTP code representing the outcome

func (*Context) StartServer

func (ctx *Context) StartServer()

Start the HTTP server

type FailureSimulation

type FailureSimulation struct {
	Enabled      bool
	FailureCount int
	SuccessCount int
	FailureCode  int
	// contains filtered or unexported fields
}

FailureSimulation desribes the intended behavior of the transient failure mode in httpr

Jump to

Keyboard shortcuts

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