workerproto

package
v1.2.9 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultRegisterPath  = "/v1/workers/register"
	DefaultHeartbeatPath = "/v1/workers/heartbeat"
	DefaultExecutePath   = "/v1/worker/execute"
	DefaultPollPath      = "/v1/worker/poll"
	DefaultCancelPath    = "/v1/worker/cancel"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CancelRequest

type CancelRequest struct {
	Task           executor.ExecuteTask `json:"task"`
	ExternalTaskID string               `json:"external_task_id"`
}

type CancelResponse

type CancelResponse struct {
	Cancelled bool   `json:"cancelled"`
	Message   string `json:"message,omitempty"`
}

type ExecuteRequest

type ExecuteRequest struct {
	Task executor.ExecuteTask `json:"task"`
}

type ExecuteResponse

type ExecuteResponse struct {
	Result executor.ExecuteResult `json:"result"`
}

type HeartbeatRequest

type HeartbeatRequest struct {
	WorkerID string `json:"worker_id"`
}

type PollRequest

type PollRequest struct {
	Task           executor.ExecuteTask `json:"task"`
	ExternalTaskID string               `json:"external_task_id"`
}

type PollResponse

type PollResponse struct {
	Result executor.ExecuteResult `json:"result"`
}

type RegisterRequest

type RegisterRequest struct {
	Worker WorkerDescriptor `json:"worker"`
}

type RegisterResponse

type RegisterResponse struct {
	Accepted bool   `json:"accepted"`
	Message  string `json:"message,omitempty"`
}

type Status

type Status string
const (
	StatusOnline  Status = "online"
	StatusOffline Status = "offline"
	StatusBusy    Status = "busy"
)

type WorkerDescriptor

type WorkerDescriptor struct {
	ID                     string            `json:"id"`
	Name                   string            `json:"name,omitempty"`
	Tenant                 string            `json:"tenant,omitempty"`
	Endpoint               string            `json:"endpoint"`
	Status                 Status            `json:"status"`
	Weight                 int               `json:"weight,omitempty"`
	MaxConcurrent          int               `json:"max_concurrent,omitempty"`
	CurrentTasks           int               `json:"current_tasks,omitempty"`
	SupportedExecutorTypes []string          `json:"supported_executor_types,omitempty"`
	SupportedExecutorRefs  []string          `json:"supported_executor_refs,omitempty"`
	Labels                 map[string]string `json:"labels,omitempty"`
	LastHeartbeatAt        time.Time         `json:"last_heartbeat_at,omitempty"`
}

Jump to

Keyboard shortcuts

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