Documentation ¶
Index ¶
- Constants
- func CloseLogFollower()
- func ComposeSetup(e2eConfig *config.E2EConfig) error
- func GetIdentity() string
- func InitLogFollower()
- func KindCleanNotify()
- func KindSetup(e2eConfig *config.E2EConfig) error
- func KindShouldWaitSignal() bool
- func NewTimeout(timeBefore time.Time, timeout time.Duration) time.Duration
- func RunCommandsAndWait(run config.Run, timeout time.Duration, cluster *util.K8sClusterInfo) error
- func RunStepsAndWait(steps []config.Step, waitTimeout time.Duration, ...) error
- func WaitPort(ctx context.Context, target wait.StrategyTarget, waitPort nat.Port, ...) (err error)
- type ComposeContainer
- type ComposeContainerListener
- type ComposeService
- type DockerContainer
- func (c *DockerContainer) ContainerIP(ctx context.Context) (string, error)
- func (c *DockerContainer) Endpoint(ctx context.Context, proto string) (string, error)
- func (c *DockerContainer) Exec(ctx context.Context, cmd []string) (int, error)
- func (c *DockerContainer) FollowOutput(consumer LogConsumer)
- func (c *DockerContainer) GetContainerID() string
- func (c *DockerContainer) Host(ctx context.Context) (string, error)
- func (c *DockerContainer) Logs(ctx context.Context) (io.ReadCloser, error)
- func (c *DockerContainer) MappedPort(ctx context.Context, port nat.Port) (nat.Port, error)
- func (c *DockerContainer) Name(ctx context.Context) (string, error)
- func (c *DockerContainer) NetworkAliases(ctx context.Context) (map[string][]string, error)
- func (c *DockerContainer) Networks(ctx context.Context) ([]string, error)
- func (c *DockerContainer) PortEndpoint(ctx context.Context, port nat.Port, proto string) (string, error)
- func (c *DockerContainer) Ports(ctx context.Context) (nat.PortMap, error)
- type DockerNetwork
- type DockerProvider
- type KindContainerListener
- type Log
- type LogConsumer
- type Network
- type NetworkRequest
Constants ¶
const ( // SeparatorV1 is the separator used in docker-compose v1 // refer to https://github.com/docker/compose/blob/5becea4ca9f68875334c92f191a13482bcd6e5cf/compose/service.py#L1492-L1498 SeparatorV1 = "_" // SeparatorV2 is the separator used in docker-compose v2 // refer to https://github.com/docker/compose/blob/981aea674d052ee1ab252f71c3ca1f9f8a7e32de/pkg/compose/convergence.go#L252-L257 SeparatorV2 = "-" )
const ( Bridge = "bridge" // Bridge network name (as well as driver) ReaperDefault = "reaper_default" // Default network name when bridge is not available TestcontainerLabel = "org.testcontainers.golang" )
Variables ¶
This section is empty.
Functions ¶
func CloseLogFollower ¶ added in v1.1.0
func CloseLogFollower()
func ComposeSetup ¶
ComposeSetup sets up environment according to e2e.yaml.
func GetIdentity ¶
func GetIdentity() string
func InitLogFollower ¶ added in v1.1.0
func InitLogFollower()
func KindShouldWaitSignal ¶ added in v1.1.0
func KindShouldWaitSignal() bool
func NewTimeout ¶
NewTimeout calculates new timeout since timeBefore.
func RunCommandsAndWait ¶
RunCommandsAndWait Concurrently run commands and wait for conditions.
func RunStepsAndWait ¶
Types ¶
type ComposeContainer ¶ added in v1.1.0
type ComposeContainer struct { Service *ComposeService ID string }
type ComposeContainerListener ¶ added in v1.1.0
type ComposeContainerListener struct {
// contains filtered or unexported fields
}
func NewComposeContainerListener ¶ added in v1.1.0
func NewComposeContainerListener(ctx context.Context, cli *client.Client, services []*ComposeService) *ComposeContainerListener
func (*ComposeContainerListener) Listen ¶ added in v1.1.0
func (c *ComposeContainerListener) Listen(consumer func(container *ComposeContainer)) error
func (*ComposeContainerListener) Stop ¶ added in v1.1.0
func (c *ComposeContainerListener) Stop()
type ComposeService ¶ added in v1.1.0
type ComposeService struct { Name string // contains filtered or unexported fields }
func (*ComposeService) FindContainer ¶ added in v1.2.0
type DockerContainer ¶
type DockerContainer struct { // Container ID from Docker ID string WaitingFor wait.Strategy Image string // contains filtered or unexported fields }
DockerContainer represents a container started using Docker
func (*DockerContainer) ContainerIP ¶
func (c *DockerContainer) ContainerIP(ctx context.Context) (string, error)
ContainerIP gets the IP address of the primary network within the container.
func (*DockerContainer) Endpoint ¶
Endpoint gets proto://host:port string for the first exposed port Will returns just host:port if proto is ""
func (*DockerContainer) FollowOutput ¶
func (c *DockerContainer) FollowOutput(consumer LogConsumer)
FollowOutput adds a LogConsumer to be sent logs from the container's STDOUT and STDERR
func (*DockerContainer) GetContainerID ¶
func (c *DockerContainer) GetContainerID() string
func (*DockerContainer) Host ¶
func (c *DockerContainer) Host(ctx context.Context) (string, error)
Host gets host (ip or name) of the docker daemon where the container port is exposed Warning: this is based on your Docker host setting. Will fail if using an SSH tunnel You can use the "TC_HOST" env variable to set this yourself
func (*DockerContainer) Logs ¶
func (c *DockerContainer) Logs(ctx context.Context) (io.ReadCloser, error)
Logs will fetch both STDOUT and STDERR from the current container. Returns a ReadCloser and leaves it up to the caller to extract what it wants.
func (*DockerContainer) MappedPort ¶
MappedPort gets externally mapped port for a container port
func (*DockerContainer) Name ¶
func (c *DockerContainer) Name(ctx context.Context) (string, error)
Name gets the name of the container.
func (*DockerContainer) NetworkAliases ¶
NetworkAliases gets the aliases of the container for the networks it is attached to.
func (*DockerContainer) Networks ¶
func (c *DockerContainer) Networks(ctx context.Context) ([]string, error)
Networks gets the names of the networks the container is attached to.
func (*DockerContainer) PortEndpoint ¶
func (c *DockerContainer) PortEndpoint(ctx context.Context, port nat.Port, proto string) (string, error)
PortEndpoint gets proto://host:port string for the given exposed port Will returns just host:port if proto is ""
type DockerNetwork ¶
DockerNetwork represents a network started using Docker
type DockerProvider ¶
type DockerProvider struct {
// contains filtered or unexported fields
}
DockerProvider implements the ContainerProvider interface
func (*DockerProvider) GetGatewayIP ¶
func (p *DockerProvider) GetGatewayIP(ctx context.Context) (string, error)
func (*DockerProvider) GetNetwork ¶
func (p *DockerProvider) GetNetwork(ctx context.Context, req NetworkRequest) (types.NetworkResource, error)
GetNetwork returns the object representing the network identified by its name
type KindContainerListener ¶ added in v1.1.0
type KindContainerListener struct {
// contains filtered or unexported fields
}
KindContainerListener listen or get all kubernetes pod
func NewKindContainerListener ¶ added in v1.1.0
func NewKindContainerListener(ctx context.Context, clientGetter *util.K8sClusterInfo) *KindContainerListener
func (*KindContainerListener) GetAllPods ¶ added in v1.1.0
func (c *KindContainerListener) GetAllPods() ([]*v1.Pod, error)
func (*KindContainerListener) Listen ¶ added in v1.1.0
func (c *KindContainerListener) Listen(consumer func(pod *v1.Pod)) error
Listen pod event
func (*KindContainerListener) Stop ¶ added in v1.1.0
func (c *KindContainerListener) Stop()
type LogConsumer ¶
type LogConsumer interface {
Accept(Log)
}