mock

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DockerClient

type DockerClient interface {
	ListContainersByLabels(ctx context.Context, labels map[string]string) ([]types.Container, error)
}

DockerClient interface for Docker operations

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager manages mock services lifecycle

func NewManager

func NewManager(registry *plugin.Registry, logger *zap.Logger, orchestration config.OrchestrationConfig, dockerClient DockerClient) *Manager

NewManager creates a new mock manager

func (*Manager) GetAllStatuses

func (m *Manager) GetAllStatuses(ctx context.Context) []*ServiceStatus

GetAllStatuses returns the status of all services

func (*Manager) GetLogs

func (m *Manager) GetLogs(ctx context.Context, serviceName string, opts *plugin.LogOptions) ([]string, error)

GetLogs retrieves logs from a service

func (*Manager) GetStatus

func (m *Manager) GetStatus(ctx context.Context, serviceName string) (*ServiceStatus, error)

GetStatus returns the status of a specific service

func (*Manager) ListRunning

func (m *Manager) ListRunning() []string

ListRunning returns a list of currently running services

func (*Manager) Start

func (m *Manager) Start(ctx context.Context, serviceName string, config map[string]interface{}) error

Start starts a specific service

func (*Manager) StartAll

func (m *Manager) StartAll(ctx context.Context, serviceConfigs map[string]map[string]interface{}) error

StartAll starts all configured mock services

func (*Manager) Stop

func (m *Manager) Stop(ctx context.Context, serviceName string) error

Stop stops a specific service

func (*Manager) StopAll

func (m *Manager) StopAll(ctx context.Context) error

StopAll stops all running services

type ServiceStatus

type ServiceStatus struct {
	Name   string
	Status string // "running", "stopped", "error", "starting"
	Port   int
	Uptime time.Duration
	Error  string
}

ServiceStatus represents the status of a service

Directories

Path Synopsis
Package stablemocks launches the third-party mocks for the component pipeline using the official public images for each tool, with a fixed docker run contract (network, ports, mounts, container names and readiness) so `gtool services up --stable` provides a reproducible mock environment that seeds data from test/component/mocks-data.
Package stablemocks launches the third-party mocks for the component pipeline using the official public images for each tool, with a fixed docker run contract (network, ports, mounts, container names and readiness) so `gtool services up --stable` provides a reproducible mock environment that seeds data from test/component/mocks-data.

Jump to

Keyboard shortcuts

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