Documentation ¶
Index ¶
- Constants
- type Cluster
- type Container
- func (c *Container) Addr(name string) *net.TCPAddr
- func (c *Container) GetJSON(port, path string, v interface{}) error
- func (c *Container) Inspect() error
- func (c *Container) Kill() error
- func (c *Container) Logs() error
- func (c *Container) Pause() error
- func (c *Container) Remove() error
- func (c *Container) Restart(timeoutSeconds int) error
- func (c *Container) Start(binds []string, dns, vols *Container) error
- func (c *Container) Stop(timeoutSeconds int) error
- func (c *Container) Unpause() error
- func (c *Container) Wait() error
- type Event
Constants ¶
const ( EventCreate = "create" EventDestroy = "destroy" EventDie = "die" EventExecCreate = "exec_create" EventExecStart = "exec_start" EventExport = "export" EventKill = "kill" EventOom = "oom" EventPause = "pause" EventRestart = "restart" EventStart = "start" EventStop = "stop" EventUnpause = "unpause" )
The various event types.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cluster ¶
type Cluster struct { Nodes []*Container Events chan Event CertsDir string LogDir string ForceLogging bool // Forces logging to disk on a per test basis // contains filtered or unexported fields }
Cluster manages a local cockroach cluster running on docker. The cluster is composed of a "dns" container which automatically registers dns entries for the cockroach nodes, a "volumes" container which manages the persistent volumes used for certs and node data and N cockroach nodes.
type Container ¶
type Container struct { ID string // contains filtered or unexported fields }
Container provides the programmatic interface for a single docker container.
func (*Container) GetJSON ¶
GetJSON retrieves the URL specified by https://Addr(<port>)<path> and unmarshals the result as JSON.
func (*Container) Remove ¶
Remove removes the container from docker. It is an error to remove a running container.
func (*Container) Restart ¶
Restart restarts a running container. Container will be killed after 'timeout' seconds if it fails to stop.
func (*Container) Start ¶
Start starts a non-running container.
TODO(pmattis): Generalize the setting of parameters here.