dockerexternal

package
v1.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 25, 2026 License: Apache-2.0 Imports: 24 Imported by: 0

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) Address

func (c *EtcdNode) Address() string

Address is the host:port of the etcd node for use by etcd clients.

func (*EtcdNode) Close

func (c *EtcdNode) Close(ctx context.Context) error

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

func (c *EtcdNode) Restart(ctx context.Context) error

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.

func (*EtcdNode) Setup

func (c *EtcdNode) Setup(ctx context.Context) (closeErr error)

Setup starts the docker container.

func (*EtcdNode) Stop

func (c *EtcdNode) Stop(ctx context.Context) error

Stop stops the etcd container, but does not purge it. A stopped container can be restarted with Restart.

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

Query executes a query request against the prometheus resource.

func (*Prometheus) Setup

func (p *Prometheus) Setup(ctx context.Context) error

Setup is a method that setups up the prometheus instance.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL