taskmanager

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActiveWorker

type ActiveWorker struct {
	WorkerID    string         `json:"workerID"`
	StartedAt   time.Time      `json:"startedAt"`
	HeartbeatAt time.Time      `json:"heartbeatAt"`
	Queues      []QueuesConfig `json:"queues"`
	PID         int            `json:"pid"`
	MemoryUsage float64        `json:"memoryUsage"`
	CPUUsage    float64        `json:"cpuUsage"`
}

type CreateJobRequest

type CreateJobRequest struct {
	Args interface{} `json:"args"`
}

type Job

type Job struct {
	ID            string      `json:"id"`
	QueueName     string      `json:"queueName"`
	Args          interface{} `json:"args"`
	CreatedAt     time.Time   `json:"createdAt"`
	StartedAt     time.Time   `json:"startedAt"`
	UpdatedAt     time.Time   `json:"updatedAt"`
	Attempts      int         `json:"attempts"`
	FailureReason string      `json:"failureReason"`
	Status        string      `json:"status"`
	ProcessedBy   string      `json:"processedBy"`
}

type ListActiveWorkersResponse

type ListActiveWorkersResponse struct {
	ActiveWorkers []ActiveWorker `json:"activeWorkers"`
}

type ListQueueJobsResponse

type ListQueueJobsResponse struct {
	NameSpace  string               `json:"namespace"`
	Name       string               `json:"name"`
	JobCount   int                  `json:"jobCount"`
	Status     string               `json:"status"`
	Pagination taskqueue.Pagination `json:"pagination"`
	Jobs       []Job                `json:"jobs"`
}

type ListQueueResponse

type ListQueueResponse struct {
	Queues []QueueInfo `json:"queues"`
}

type Logger

type Logger interface {
	Info(msg string, args ...interface{})
	Debug(msg string, args ...interface{})
	Error(msg string, args ...interface{})
}

type MetricValue

type MetricValue struct {
	TimeStamp int64   `json:"timestamp"`
	Value     float64 `json:"value"`
}

type MetricsQueryParam

type MetricsQueryParam struct {
	Name  string
	Start time.Time
	End   time.Time
	Step  time.Duration
}

type MetricsRange

type MetricsRange struct {
	Metric struct {
		Name   string            `json:"name"`
		Labels map[string]string `json:"labels"`
	} `json:"metric"`
	Values []MetricValue `json:"values"`
}

type QueueInfo

type QueueInfo struct {
	NameSpace string `json:"namespace"`
	Name      string `json:"name"`
	JobCount  int    `json:"jobCount"`
	Status    string `json:"status"`
}

type QueuesConfig

type QueuesConfig struct {
	QueueName   string `json:"queueName"`
	Concurrency int    `json:"concurrency"`
}

type Server

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

func NewServer

func NewServer(opts *ServerOptions) *Server

func (*Server) Start

func (s *Server) Start(ctx context.Context) error

type ServerOptions

type ServerOptions struct {
	TaskQueue      taskqueue.Queue
	HeartBeater    taskqueue.HeartBeater
	MetricsBackend taskqueue.Metrics
	Addr           string
	WebStaticDir   string
	Logger         Logger
}

type TogglePendingQueueStatusResponse

type TogglePendingQueueStatusResponse struct {
	NewStatus string `json:"newStatus"`
	OldStatus string `json:"oldStatus"`
}

Jump to

Keyboard shortcuts

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