client

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2025 License: GPL-3.0 Imports: 8 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) 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) 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 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"`
	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"`
}

JobRequest represents a request to start or stop containers

type JobResponse

type JobResponse struct {
	ID     string `json:"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