server

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2016 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatTime

func FormatTime(unixTime int64) string

FormatTime takes a UnixDate and transforms it into YYYY-mm-dd HH:MM:SS

func NewRouter

func NewRouter(scheduler eremetic.Scheduler, conf *config.Config, db eremetic.TaskDB) *mux.Router

NewRouter is used to create a new router.

Types

type Handler

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

Handler holds the server context.

func NewHandler

func NewHandler(scheduler eremetic.Scheduler, database eremetic.TaskDB) Handler

NewHandler returns a new instance of Handler.

func (Handler) AddTask

func (h Handler) AddTask() http.HandlerFunc

AddTask handles adding a task to the queue

func (Handler) GetFromSandbox

func (h Handler) GetFromSandbox(file string) http.HandlerFunc

GetFromSandbox fetches a file from the sandbox of the agent that ran the task

func (Handler) GetTaskInfo

func (h Handler) GetTaskInfo(conf *config.Config) http.HandlerFunc

GetTaskInfo returns information about the given task.

func (Handler) IndexHandler

func (h Handler) IndexHandler(conf *config.Config) http.HandlerFunc

IndexHandler returns the index template, or no content.

func (Handler) ListRunningTasks

func (h Handler) ListRunningTasks() http.HandlerFunc

ListRunningTasks returns information about running tasks in the database.

func (Handler) NotFound

func (h Handler) NotFound() http.HandlerFunc

NotFound is in charge of reporting that a task can not be found.

func (Handler) StaticAssets

func (h Handler) StaticAssets() http.Handler

StaticAssets handles the serving of compiled static assets.

func (Handler) Version

func (h Handler) Version(conf *config.Config) http.HandlerFunc

Version returns the currently running Eremetic version.

type Route

type Route struct {
	Name    string
	Method  string
	Pattern string
	Handler http.Handler
}

Route enforces the structure of a route

type Routes

type Routes []Route

Routes is a collection of route structs

Jump to

Keyboard shortcuts

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