gatewayclient

package
v0.1.92 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2026 License: AGPL-3.0, AGPL-3.0-or-later Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GatewayClient

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

GatewayClient is a gRPC client for communicating with the gateway.

func NewGatewayClient

func NewGatewayClient(addr string, authToken string) (*GatewayClient, error)

NewGatewayClient creates a new gateway gRPC client.

func (*GatewayClient) AllocateIP

func (c *GatewayClient) AllocateIP(ctx context.Context, sandboxID, workerID string) (*types.IPAllocation, error)

AllocateIP requests an IP allocation for a sandbox from the gateway.

func (*GatewayClient) Close

func (c *GatewayClient) Close() error

Close closes the gRPC connection.

func (*GatewayClient) Deregister

func (c *GatewayClient) Deregister(ctx context.Context, workerId string) error

Deregister removes the worker from the gateway.

func (*GatewayClient) GetWorker

func (c *GatewayClient) GetWorker(ctx context.Context, workerId string) (*types.Worker, error)

GetWorker retrieves worker information.

func (*GatewayClient) Heartbeat

func (c *GatewayClient) Heartbeat(ctx context.Context, workerId string) error

Heartbeat sends a heartbeat for the worker.

func (*GatewayClient) RegisterWorker

RegisterWorker registers a worker with the gateway.

func (*GatewayClient) ReleaseIP

func (c *GatewayClient) ReleaseIP(ctx context.Context, sandboxID string) error

ReleaseIP releases an IP allocation for a sandbox.

func (*GatewayClient) SetTaskResult

func (c *GatewayClient) SetTaskResult(ctx context.Context, taskID string, exitCode int, errorMsg string, attemptID string) error

SetTaskResult reports the result of a task to the gateway.

func (*GatewayClient) SetTaskStarted

func (c *GatewayClient) SetTaskStarted(ctx context.Context, taskID string, attemptID string) error

SetTaskStarted marks a task as running in Postgres.

func (*GatewayClient) UpdateStatus

func (c *GatewayClient) UpdateStatus(ctx context.Context, workerId string, workerStatus types.WorkerStatus) error

UpdateStatus updates the worker's status.

type RegisterWorkerRequest

type RegisterWorkerRequest struct {
	Hostname string
	PoolName string
	Cpu      int64
	Memory   int64
	Version  string
}

RegisterWorkerRequest is the request for registering a worker.

type RegisterWorkerResponse

type RegisterWorkerResponse struct {
	WorkerID string
}

RegisterWorkerResponse is the response from registering a worker.

Jump to

Keyboard shortcuts

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