handlers

package
v0.0.0-...-15bb17a Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2024 License: MIT Imports: 18 Imported by: 1

Documentation

Overview

Package handlers implements the http handlers for the api and defines the Server structure for shared context between handlers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JobStatusNotification

type JobStatusNotification struct {
	Time   string                      `json:"time"`
	Detail JobStatusNotificationDetail `json:"detail"`
}

This structure and the ones below it match the CloudWatch event JSON we get from AWS Lambda function. It doesn't match all the fields but matches most of the useful ones we track.

type JobStatusNotificationContainer

type JobStatusNotificationContainer struct {
	Image       string   `json:"image"`
	Vcpus       int64    `json:"vcpus"`
	Memory      int64    `json:"memory"`
	Command     []string `json:"command"`
	Environment []env    `json:"environment"`
	TaskArn     *string  `json:"taskArn"`
}

type JobStatusNotificationDetail

type JobStatusNotificationDetail struct {
	JobName       string                         `json:"jobName"`
	JobId         string                         `json:"jobId"`
	JobQueue      string                         `json:"jobQueue"`
	Status        string                         `json:"status"`
	CreatedAt     int64                          `json:"createdAt"`
	StartedAt     *int64                         `json:"startedAt"`
	Container     JobStatusNotificationContainer `json:"container"`
	JobDefinition string                         `json:"jobDefinition"`
}

type KillTaskID

type KillTaskID struct {
	ID string `json:"id" form:"id" query:"id"`
}

KillTaskID is a struct to handle JSON request to kill a task

type KillTasks

type KillTasks struct {
	IDs []string `json:"ids" form:"ids" query:"ids"`
}

KillTasks is a struct to handle JSON request to kill many tasks

func BodyToKillTask

func BodyToKillTask(c echo.Context) (KillTasks, error)

type Server

type Server struct {
	Storage jobs.FinderStorer
	Killer  jobs.Killer
	Index   []byte
}

func (*Server) ActivateJobQueue

func (s *Server) ActivateJobQueue(c echo.Context) error

func (*Server) DeactivateJobQueue

func (s *Server) DeactivateJobQueue(c echo.Context) error

func (*Server) FetchLogs

func (s *Server) FetchLogs(c echo.Context) error

func (*Server) Find

func (s *Server) Find(c echo.Context) error

Find is a request handler, returns json with jobs matching the query param 'q'

func (*Server) FindOne

func (s *Server) FindOne(c echo.Context) error

FindOne is a request handler, returns a job matching the query parameter 'q'

func (*Server) GetStatus

func (s *Server) GetStatus(c echo.Context) error

func (*Server) IndexHandler

func (s *Server) IndexHandler(c echo.Context) error

IndexHandler returns

func (*Server) JobStats

func (s *Server) JobStats(c echo.Context) error

Stats

func (*Server) JobStatusNotification

func (s *Server) JobStatusNotification(c echo.Context) error

func (*Server) KillMany

func (s *Server) KillMany(c echo.Context) error

KillMany is a request handler, kills a job matching the post parameter 'id' (AWS task ID)

func (*Server) KillOne

func (s *Server) KillOne(c echo.Context) error

KillOne is a request handler, kills a job matching the post parameter 'id' (AWS task ID)

func (*Server) ListActiveJobQueues

func (s *Server) ListActiveJobQueues(c echo.Context) error

func (*Server) ListAllJobQueues

func (s *Server) ListAllJobQueues(c echo.Context) error

func (*Server) SubscribeToJobEvent

func (s *Server) SubscribeToJobEvent(c echo.Context) error

Jump to

Keyboard shortcuts

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