Documentation
¶
Index ¶
- type AppStatus
- type DockerClient
- type DockerManager
- func (m *DockerManager) Logs(ctx context.Context, tail int) ([]string, error)
- func (m *DockerManager) Restart(ctx context.Context, cfg *plugin.AppConfig) error
- func (m *DockerManager) Start(ctx context.Context, cfg *plugin.AppConfig) error
- func (m *DockerManager) Status(ctx context.Context) (*AppStatus, error)
- func (m *DockerManager) Stop(ctx context.Context) error
- type GenericLauncher
- func (l GenericLauncher) GetPID() (int, error)
- func (l GenericLauncher) IsReady(_ context.Context) (bool, error)
- func (l GenericLauncher) Launch(ctx context.Context, config *plugin.AppConfig) error
- func (l GenericLauncher) Restart(ctx context.Context) error
- func (l GenericLauncher) Stop(_ context.Context) error
- func (l GenericLauncher) Technology() string
- type GolangLauncher
- func (l GolangLauncher) GetPID() (int, error)
- func (l GolangLauncher) IsReady(_ context.Context) (bool, error)
- func (l GolangLauncher) Launch(ctx context.Context, config *plugin.AppConfig) error
- func (l GolangLauncher) Restart(ctx context.Context) error
- func (l GolangLauncher) Stop(_ context.Context) error
- func (l GolangLauncher) Technology() string
- type Manager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DockerClient ¶
type DockerClient interface {
PullImage(ctx context.Context, image string) error
CreateContainer(ctx context.Context, config *docker.ContainerConfig) (string, error)
StartContainer(ctx context.Context, containerID string) error
StopContainer(ctx context.Context, containerID string, timeout *int) error
RemoveContainer(ctx context.Context, containerID string, force bool) error
ListContainersByLabels(ctx context.Context, labels map[string]string) ([]types.Container, error)
GetContainerLogs(ctx context.Context, containerID string, tail int) (string, error)
}
DockerClient is the subset of *docker.Client used by the DockerManager.
type DockerManager ¶
type DockerManager struct {
// contains filtered or unexported fields
}
DockerManager runs the application under test as a Docker container. Like the mock services, the container is labelled so separate CLI invocations can find it again.
func NewDockerManager ¶
func NewDockerManager(dockerClient DockerClient, logger *zap.Logger) *DockerManager
NewDockerManager creates a Docker-backed app manager.
func (*DockerManager) Start ¶
Start launches the application container. It fails if an application is already running.
type GenericLauncher ¶
type GenericLauncher struct {
// contains filtered or unexported fields
}
GenericLauncher runs an arbitrary local executable or script as the application under test, with a TCP readiness probe.
func NewGenericLauncher ¶
func NewGenericLauncher(procMgr *process.Manager, logger *zap.Logger) *GenericLauncher
NewGenericLauncher creates a generic launcher backed by the given process manager.
func (GenericLauncher) IsReady ¶
IsReady reports whether the application is up. With a configured port it runs the technology-specific probe; otherwise a running process is considered ready.
func (GenericLauncher) Restart ¶
Restart stops and relaunches the application with the original config.
func (GenericLauncher) Technology ¶
func (l GenericLauncher) Technology() string
Technology returns the launcher identifier.
type GolangLauncher ¶
type GolangLauncher struct {
// contains filtered or unexported fields
}
GolangLauncher runs a compiled Go application as the application under test, with an HTTP readiness probe (any HTTP response means the server is up).
func NewGolangLauncher ¶
func NewGolangLauncher(procMgr *process.Manager, logger *zap.Logger) *GolangLauncher
NewGolangLauncher creates a Go launcher backed by the given process manager.
func (GolangLauncher) IsReady ¶
IsReady reports whether the application is up. With a configured port it runs the technology-specific probe; otherwise a running process is considered ready.
func (GolangLauncher) Restart ¶
Restart stops and relaunches the application with the original config.
func (GolangLauncher) Technology ¶
func (l GolangLauncher) Technology() string
Technology returns the launcher identifier.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager manages application lifecycle
func NewManager ¶
func NewManager(launcher plugin.AppLauncher) *Manager
NewManager creates a new app manager
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package nativeapp reproduces the legacy DIA component tool's golang app launcher (app-launchers/golang.bash, no docker image): it starts the project binaries built into $GOPATH/bin as detached native processes, each on an incrementing port with the emulator host env vars, and stops them by name.
|
Package nativeapp reproduces the legacy DIA component tool's golang app launcher (app-launchers/golang.bash, no docker image): it starts the project binaries built into $GOPATH/bin as detached native processes, each on an incrementing port with the emulator host env vars, and stops them by name. |