Documentation ¶
Overview ¶
Package Toxiproxy provides a client wrapper around the Toxiproxy HTTP API for testing the resiliency of Go applications.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client holds information about where to connect to Toxiproxy.
func NewClient ¶
NewClient creates a new client which provides the base of all communication with Toxiproxy. Endpoint is the address to the proxy (e.g. localhost:8474 if not overriden)
func (*Client) NewProxy ¶
NewProxy instantiates a new proxy instance. Note Create() must be called on it to create it. The Enabled field must be set to true, otherwise the Proxy will not be enabled when created.
func (*Client) ResetState ¶
ResetState resets the state of all proxies and toxics in Toxiproxy.
type Proxy ¶
type Proxy struct { Name string `json:"name"` // The name of the proxy Listen string `json:"listen"` // The address the proxy listens on Upstream string `json:"upstream"` // The upstream address to proxy to Enabled bool `json:"enabled"` // Whether the proxy is enabled ToxicsUpstream Toxics `json:"upstream_toxics"` // Toxics in the upstream direction ToxicsDownstream Toxics `json:"downstream_toxics"` // Toxics in the downstream direction // contains filtered or unexported fields }
Proxy represents a Proxy.
func (*Proxy) Delete ¶
Delete a proxy which will cause it to stop listening and delete all information associated with it. If you just wish to stop and later enable a proxy, set the `Enabled` field to `false` and call `Save()`.
func (*Proxy) SetToxic ¶ added in v1.0.2
SetToxic sets the parameters for a toxic with a given name in the direction. See https://github.com/Shopify/toxiproxy#toxics for a list of all Toxics.