taskapi

package
v0.0.0-...-4caa0be Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	DB *gorm.DB
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(w worker.Worker, db *gorm.DB) *Handler

func (*Handler) GetListOfRunningTasks

func (h *Handler) GetListOfRunningTasks(c echo.Context) error

func (*Handler) GetSingleTaskInformation

func (h *Handler) GetSingleTaskInformation(c echo.Context) error

func (*Handler) InitRoutes

func (h *Handler) InitRoutes(e *echo.Echo)

func (*Handler) StartTask

func (h *Handler) StartTask(c echo.Context) error

func (*Handler) StopTask

func (h *Handler) StopTask(c echo.Context) error

type Resources

type Resources struct {
	Memory int64   `json:"memory"`
	Cpus   float32 `json:"cpus"`
}

type ScaleConfig

type ScaleConfig struct {
	TaskName        string `json:"taskName"`
	MinTaskScale    int    `json:"minTaskScale"`
	MaxTaskScale    int    `json:"maxTaskScale"`
	ScalingStrategy string `json:"scalingStrategy"`
}

type TaskMetrics

type TaskMetrics struct {
	ContainerId string          `json:"containerId"`
	TaskName    string          `json:"taskName"`
	Stats       types.StatsJSON `json:"stats"`
}

type TaskRequest

type TaskRequest struct {
	Name        string            `json:"name"`
	Image       string            `json:"image"`
	ID          string            `json:"id"`
	PortMapping map[string]string `json:"portMapping"`
	Resources   Resources         `json:"resources"`
	ScaleConfig ScaleConfig       `json:"scaleConfig"`
}

type TaskResponse

type TaskResponse struct {
	ID    string `json:"id"`
	Name  string `json:"name"`
	Image string `json:"image"`
	State string `json:"state"`
}

Jump to

Keyboard shortcuts

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