api

package
v0.0.0-...-9172df8 Latest Latest
Warning

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

Go to latest
Published: May 22, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CSS

func CSS(w http.ResponseWriter, r *http.Request)

CSS ... /static/{file}.css endpoint

func Index

func Index(w http.ResponseWriter, r *http.Request)

Index ... / endpoint, serves up the HTML page

func JS

func JS(w http.ResponseWriter, r *http.Request)

JS ... /static/{file}.js endpoint

func LogRequest

func LogRequest(next http.HandlerFunc) http.HandlerFunc

LogRequest ... Request logging middleware.

Types

type CachePayload

type CachePayload struct {
	Expires time.Time    `json:"expires"`
	Jobs    []*model.Job `json:"jobs"`
}

CachePayload ... Cache DTO

type JobController

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

JobController ... /jobs endpoint controller.

func NewJobController

func NewJobController(c cache.JobCacher, o Outcomer) *JobController

NewJobController ... Make a new job controller

func (*JobController) All

All ... /jobs endpoint, returns entire job cache as JSON

func (*JobController) Detail

func (j *JobController) Detail(w http.ResponseWriter, r *http.Request)

Detail ... /job/:id?start_dt&start_tm

func (*JobController) Since

func (j *JobController) Since(w http.ResponseWriter, r *http.Request)

Since ... /jobs?since=20170728

type OutcomePayload

type OutcomePayload struct {
	JobID    string    `json:"job_id"`
	JobName  string    `json:"name"`
	StepID   int       `json:"step_id"`
	Name     string    `json:"step_name"`
	Message  string    `json:"message"`
	RunDate  time.Time `json:"run_date"`
	Duration int       `json:"run_duration"`
	Result   string    `json:"run_result"`
}

OutcomePayload ... Job outcome payload

func NewOutcomePayload

func NewOutcomePayload(outcomes []*model.Outcome) []*OutcomePayload

NewOutcomePayload ...

type Outcomer

type Outcomer interface {
	GetOutcome(q model.OutcomeQuery) ([]*model.Outcome, error)
	AllSince(dt int) ([]*model.Outcome, error)
}

Outcomer ...

Jump to

Keyboard shortcuts

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