service

package
v0.0.0-...-d772fc0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2016 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KhronosService

type KhronosService struct {
	Config  *config.AppConfig
	Storage storage.Client
	Cron    *schedule.Cron
}

KhronosService is the application served

func NewKhronosService

func NewKhronosService(cfg *config.AppConfig, storage storage.Client, cron *schedule.Cron) *KhronosService

NewKhronosService creates a service object ready to be served.

func (*KhronosService) AuthenticationHandler

func (s *KhronosService) AuthenticationHandler(f http.Handler) http.Handler

AuthenticationHandler Checks the application security, Authorization header and let it pass if correct.

func (*KhronosService) CreateNewJob

func (s *KhronosService) CreateNewJob(r *http.Request) (int, interface{}, error)

CreateNewJob Creates and registers a new job

func (*KhronosService) DeleteJob

func (s *KhronosService) DeleteJob(r *http.Request) (int, interface{}, error)

DeleteJob Deletes a job and its results

func (*KhronosService) DeleteResult

func (s *KhronosService) DeleteResult(r *http.Request) (int, interface{}, error)

DeleteResult deletes a result

func (*KhronosService) GetJob

func (s *KhronosService) GetJob(r *http.Request) (int, interface{}, error)

GetJob returns a single job by id

func (*KhronosService) GetJobs

func (s *KhronosService) GetJobs(r *http.Request) (int, interface{}, error)

GetJobs returns a list of jobs

func (*KhronosService) GetResult

func (s *KhronosService) GetResult(r *http.Request) (int, interface{}, error)

GetResult returns a single result by id

func (*KhronosService) GetResults

func (s *KhronosService) GetResults(r *http.Request) (int, interface{}, error)

GetResults returns the jobs from an specific job

func (*KhronosService) JSONEndpoints

func (s *KhronosService) JSONEndpoints() map[string]map[string]server.JSONEndpoint

JSONEndpoints maps the routes to the enpoints

func (*KhronosService) JSONMiddleware

func (s *KhronosService) JSONMiddleware(j server.JSONEndpoint) server.JSONEndpoint

JSONMiddleware wraps all the requests around this middlewares

func (*KhronosService) Middleware

func (s *KhronosService) Middleware(h http.Handler) http.Handler

Middleware registers the middlewares to execute in the request flow

func (*KhronosService) Ping

func (s *KhronosService) Ping(r *http.Request) (int, interface{}, error)

Ping informs service is alive

func (*KhronosService) Prefix

func (s *KhronosService) Prefix() string

Prefix returns the prefix of the service (used by gizmo)

Directories

Path Synopsis
Package validate implements utilities to validate properties and objects
Package validate implements utilities to validate properties and objects

Jump to

Keyboard shortcuts

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