Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EtcdClusterOption ¶
type EtcdClusterOption interface {
// contains filtered or unexported methods
}
EtcdClusterOption configure an etcd cluster.
func EtcdClusterPort ¶
func EtcdClusterPort(port int) EtcdClusterOption
EtcdClusterPort sets a specific port for etcd to listen on. Default is to listen on :0 (any free port).
func EtcdClusterUseBridge ¶
func EtcdClusterUseBridge(shouldUseBridge bool) EtcdClusterOption
EtcdClusterUseBridge configures an EtcdNode to insert a networking "bridge" between the etcd container and the calling processes. The bridge intercepts network traffic, and forwards it, unless told not to via e.g. Blackhole(). See the bridge package. As noted in that package, this implementation is lifted directly from the etcd/integration package; all credit goes to etcd authors for the approach.
type EtcdNode ¶
type EtcdNode struct {
// contains filtered or unexported fields
}
EtcdNode is a single etcd node, running via a docker container.
func NewEtcd ¶
func NewEtcd( pool dockertest.Pool, instrumentOpts instrument.Options, options ...EtcdClusterOption, ) (*EtcdNode, error)
NewEtcd constructs a single etcd node, running in a docker container.
func (*EtcdNode) Close ¶
Close stops the etcd node, and removes it. Closing a node whose Setup never succeeded is a no-op, so that a deferred Close in a test does not turn a startup failure into a nil pointer panic that hides the real error.
func (*EtcdNode) Restart ¶
Restart restarts the etcd container. If it isn't currently stopped, the etcd container will be stopped and then started; else it will just be start.
type Prometheus ¶
type Prometheus struct {
// contains filtered or unexported fields
}
Prometheus is a docker-backed instantiation of Prometheus.
func NewPrometheus ¶
func NewPrometheus(opts PrometheusOptions) *Prometheus
NewPrometheus creates a new docker-backed Prometheus that implements the resources.ExternalResources interface.
func (*Prometheus) Close ¶
func (p *Prometheus) Close(context.Context) error
Close cleans up the prometheus instance.
func (*Prometheus) Query ¶
func (p *Prometheus) Query(req PrometheusQueryRequest) (model.Vector, error)
Query executes a query request against the prometheus resource.
type PrometheusOptions ¶
type PrometheusOptions struct {
// Pool is the connection to the docker API
Pool dockertest.Pool
// PathToCfg contains the path to the prometheus.yml configuration
// file to be used on startup.
PathToCfg string
// InstrumentOptions are the instrument.Options to use when
// creating the resource.
InstrumentOptions instrument.Options
}
PrometheusOptions contains the options for spinning up docker container running Prometheus
type PrometheusQueryRequest ¶
type PrometheusQueryRequest struct {
// Query is the prometheus query to execute
Query string
// Time is the time to execute the query at
Time time.Time
}
PrometheusQueryRequest contains the parameters for making a query request.
func (*PrometheusQueryRequest) String ¶
func (p *PrometheusQueryRequest) String() string
String converts the query request into a string suitable for use in the url params or request body
Directories
¶
| Path | Synopsis |
|---|---|
|
Package etcdintegration is a mostly drop-in replacement for the etcd integration (github.com/etcd-io/etcd/tests/v3/framework/integration) package.
|
Package etcdintegration is a mostly drop-in replacement for the etcd integration (github.com/etcd-io/etcd/tests/v3/framework/integration) package. |