Documentation
¶
Overview ¶
Package etcdintegration is a mostly drop-in replacement for the etcd integration (github.com/etcd-io/etcd/tests/v3/framework/integration) package. Instead of starting etcd within this Go process, it starts etcd using a docker container.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BeforeTestExternal ¶
func BeforeTestExternal(t testingT)
BeforeTestExternal -- solely here to match etcd API's.
func WaitClientV3 ¶
WaitClientV3 waits for an etcd client to be healthy.
Types ¶
type Cluster ¶
type Cluster struct {
// Members are the etcd nodes that make up the cluster.
Members []*Node
// contains filtered or unexported fields
}
Cluster is an etcd cluster. Currently, the implementation is such that only one node clusters are allowed.
func NewCluster ¶
func NewCluster(t testingT, cfg *ClusterConfig) *Cluster
NewCluster starts an etcd cluster using docker.
func (*Cluster) RandClient ¶
RandClient returns a client from any member in the cluster.
type ClusterConfig ¶
type ClusterConfig struct {
// Size is the number of nodes in the cluster. Provided as a parameter to be API compatible with the etcd package,
// but currently only one node is supported.
Size int
// UseBridge enables a networking bridge on etcd members, accessible via Node.Bridge(). This allows manipulation
// of connections to particular members.
UseBridge bool
}
ClusterConfig configures an etcd integration test cluster.
type Node ¶
Node is a single etcd server process, running in a docker container.
func (*Node) Bridge ¶
Bridge can be used to manipulate connections to this etcd node. It is a man-in-the-middle listener which mostly transparently forwards connections, unless told to drop them via e.g. the Blackhole method. Bridge will only be active if cfg.UseBridge is true; calling this method otherwise will panic.