Documentation
¶
Index ¶
- type Gateway
- func (g *Gateway) GRPCAddr() string
- func (g *Gateway) GRPCServer() *grpc.Server
- func (g *Gateway) Scheduler() *scheduler.Scheduler
- func (g *Gateway) Shutdown()
- func (g *Gateway) SourceRegistry() *sources.Registry
- func (g *Gateway) Start() error
- func (g *Gateway) StartAsync() error
- func (g *Gateway) ToolRegistry() *tools.Registry
- type GatewayClient
- func (c *GatewayClient) AllocateIP(ctx context.Context, sandboxID, workerID string) (*types.IPAllocation, error)
- func (c *GatewayClient) Close() error
- func (c *GatewayClient) Deregister(ctx context.Context, workerId string) error
- func (c *GatewayClient) GetWorker(ctx context.Context, workerId string) (*types.Worker, error)
- func (c *GatewayClient) Heartbeat(ctx context.Context, workerId string) error
- func (c *GatewayClient) RegisterWorker(ctx context.Context, req *RegisterWorkerRequest) (*RegisterWorkerResponse, error)
- func (c *GatewayClient) ReleaseIP(ctx context.Context, sandboxID string) error
- func (c *GatewayClient) SetTaskResult(ctx context.Context, taskID string, exitCode int, errorMsg string) error
- func (c *GatewayClient) SetTaskStarted(ctx context.Context, taskID string) error
- func (c *GatewayClient) UpdateStatus(ctx context.Context, workerId string, workerStatus types.WorkerStatus) error
- type RegisterWorkerRequest
- type RegisterWorkerResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Gateway ¶
type Gateway struct {
Config types.AppConfig
RedisClient *common.RedisClient
BackendRepo repository.BackendRepository
// contains filtered or unexported fields
}
func NewGateway ¶
func (*Gateway) GRPCServer ¶
GRPCServer returns the gRPC server for registering services
func (*Gateway) Shutdown ¶
func (g *Gateway) Shutdown()
Shutdown gracefully shuts down the gateway (exported for external use)
func (*Gateway) SourceRegistry ¶
SourceRegistry returns the source registry for registering providers
func (*Gateway) StartAsync ¶
Start is the gateway entry point StartAsync starts the gateway servers without blocking. Use this when embedding the gateway in another process (e.g., CLI).
func (*Gateway) ToolRegistry ¶
ToolRegistry returns the tool registry for registering providers
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 ¶ added in v0.1.23
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) Heartbeat ¶
func (c *GatewayClient) Heartbeat(ctx context.Context, workerId string) error
Heartbeat sends a heartbeat for the worker
func (*GatewayClient) RegisterWorker ¶
func (c *GatewayClient) RegisterWorker(ctx context.Context, req *RegisterWorkerRequest) (*RegisterWorkerResponse, error)
RegisterWorker registers a worker with the gateway
func (*GatewayClient) ReleaseIP ¶ added in v0.1.23
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) error
SetTaskResult reports the result of a task to the gateway
func (*GatewayClient) SetTaskStarted ¶ added in v0.1.28
func (c *GatewayClient) SetTaskStarted(ctx context.Context, taskID 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