Documentation
¶
Index ¶
- func DockerGateway() string
- func IsRunning(ctx context.Context, name string) bool
- func Start(ctx context.Context, name string, services []sdk.Service) error
- func Stop(ctx context.Context, name string) error
- func Target(ctx context.Context, name string) string
- func WaitProbe(ctx context.Context, timeout time.Duration, fn func() error) error
- func WaitReady(ctx context.Context, addr string, timeout time.Duration) error
- type LabInfo
- type ServiceInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DockerGateway ¶
func DockerGateway() string
DockerGateway returns the default Docker bridge gateway IP.
func Start ¶
Start creates and starts containers for the given lab services.
Each service gets a network alias matching its Name so services can reference each other by short name (like docker compose). Services with a healthcheck are waited on before starting the next service, giving dependencies time to become ready.
func Target ¶
Target queries Docker for the actual mapped port of a running lab. Since labs use random host ports, we can't read from static config.
Types ¶
type LabInfo ¶
type LabInfo struct {
Name string
Services []ServiceInfo
}
LabInfo holds status for a lab.
Click to show internal directories.
Click to hide internal directories.