Documentation ¶
Index ¶
- func Find(t *testing.T, executable string) string
- func NewConsul(t *testing.T, ccc ConsulConfigCallback) (*Consul, Wait, Stop)
- func NewConsulContext(ctx context.Context, t *testing.T, ccc ConsulConfigCallback) (*Consul, Wait, Stop)
- type APIConsulConfigCallback
- type Consul
- type ConsulConfig
- type ConsulConfigCallback
- type Performance
- type PortsConfig
- type Stop
- type Telemetry
- type Wait
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Find ¶ added in v0.0.1
Find will attempt to locate executable by searching in a few common places in a sensible order for the context of a test case.
Find will search for executable in the order of - the current process - in $PATH - in $GOPATH/bin - in $CWD - in $CWD/bin - in $GOBIN
func NewConsulContext ¶
Types ¶
type APIConsulConfigCallback ¶
type Consul ¶
type Consul struct { Cmd *exec.Cmd Config *ConsulConfig }
func (*Consul) ClientWithConfig ¶
type ConsulConfig ¶
type ConsulConfig struct { NodeName string `json:"node_name"` LogLevel string `json:"log_level"` Ports *PortsConfig `json:"ports"` Bind string `json:"bind_addr"` DataDir string `json:"data_dir"` Bootstrap bool `json:"bootstrap"` Server bool `json:"server"` Telemetry *Telemetry `json:"telemetry"` DisableCheckpoint bool `json:"disable_update_check,omitempty"` Performance *Performance `json:"performance,omitempty"` }
func DefaultConsulConfig ¶
func DefaultConsulConfig(t *testing.T) *ConsulConfig
type ConsulConfigCallback ¶
type ConsulConfigCallback func(c *ConsulConfig)
type Performance ¶
type Performance struct {
RaftMultiplier int `json:"raft_multiplier,omitempty"`
}
type PortsConfig ¶
type PortsConfig struct { RPC int `json:"server,omitempty"` // Consul (-server-port, ports.server) (8300) DNS int `json:"dns,omitempty"` // Consul HTTP int `json:"http,omitempty"` HTTPS int `json:"https,omitempty"` GRPC int `json:"grpc,omitempty"` SerfLAN int `json:"serf_lan,omitempty"` SerfWAN int `json:"serf_wan,omitempty"` }
func FreeConsulPorts ¶
func FreeConsulPorts(t *testing.T) *PortsConfig
func (*PortsConfig) Cleanup ¶
func (pc *PortsConfig) Cleanup()
Directories ¶
Path | Synopsis |
---|---|
Package freeport provides a helper for reserving free TCP ports across multiple processes on the same machine.
|
Package freeport provides a helper for reserving free TCP ports across multiple processes on the same machine. |
Package retry provides support for repeating operations in tests.
|
Package retry provides support for repeating operations in tests. |
Click to show internal directories.
Click to hide internal directories.