client

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: GPL-3.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 Client

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

Client represents an HTTP client for communicating with the controller server

func NewClient

func NewClient(baseURL string, logger *logger.Logger) *Client

NewClient creates a new controller client

func (*Client) GetJob

func (c *Client) GetJob(ctx context.Context, jobID string) (*Job, error)

GetJob retrieves job status and results

func (*Client) Health

func (c *Client) Health(ctx context.Context) error

Health checks if the server is healthy

func (*Client) Ready added in v1.0.7

func (c *Client) Ready(ctx context.Context) error

Ready checks operational readiness and falls back to the v1 liveness route.

func (*Client) SetUserAgent added in v1.0.4

func (c *Client) SetUserAgent(userAgent string)

SetUserAgent sets a custom User-Agent header for requests

func (*Client) StartContainers

func (c *Client) StartContainers(ctx context.Context, timeout int, ignore []string) (*JobResponse, error)

StartContainers submits a job to start containers

func (*Client) StopContainers

func (c *Client) StopContainers(ctx context.Context, timeout int, ignore []string) (*JobResponse, error)

StopContainers submits a job to stop containers

func (*Client) StopContainersForShutdown added in v1.0.7

func (c *Client) StopContainersForShutdown(ctx context.Context, timeout int, ignore []string) (*JobResponse, error)

StopContainersForShutdown submits the stop operation that gates helper shutdown.

func (*Client) WaitForJob

func (c *Client) WaitForJob(ctx context.Context, jobID string, pollInterval time.Duration) (*Job, error)

WaitForJob waits for a job to complete (completed or failed status)

func (*Client) WaitForServerReady

func (c *Client) WaitForServerReady(ctx context.Context, timeout time.Duration) error

WaitForServerReady waits for the server to become ready

type ContainerResult added in v1.0.7

type ContainerResult struct {
	Container string `json:"container"`
	Outcome   string `json:"outcome"`
	Reason    string `json:"reason,omitempty"`
	Error     string `json:"error,omitempty"`
}

type HTTPError added in v1.0.7

type HTTPError struct {
	StatusCode int
	Body       string
}

func (*HTTPError) Error added in v1.0.7

func (e *HTTPError) Error() string

type HealthResponse

type HealthResponse struct {
	Status string `json:"status"`
}

HealthResponse represents the health check response

type Job

type Job struct {
	ID        string            `json:"id"`
	Type      string            `json:"type"`
	Status    string            `json:"status"`
	CreatedAt time.Time         `json:"created_at"`
	StartedAt time.Time         `json:"started_at"`
	EndedAt   time.Time         `json:"ended_at"`
	Timeout   int               `json:"timeout"`
	Ignore    []string          `json:"ignore,omitempty"`
	Started   []string          `json:"started,omitempty"`
	Stopped   []string          `json:"stopped,omitempty"`
	Skipped   []string          `json:"skipped,omitempty"`
	Failed    []string          `json:"failed,omitempty"`
	Outcomes  []ContainerResult `json:"outcomes,omitempty"`
	Error     string            `json:"error,omitempty"`
}

Job represents a job's full state

type JobRequest

type JobRequest struct {
	Timeout  int      `json:"timeout"`
	Ignore   []string `json:"ignore,omitempty"`
	Shutdown bool     `json:"shutdown,omitempty"`
}

JobRequest represents a request to start or stop containers

type JobResponse

type JobResponse struct {
	ID     string `json:"job_id"`
	Status string `json:"status"`
}

JobResponse represents a job creation response

Jump to

Keyboard shortcuts

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