handlers

package
v0.0.0-...-735ccfd Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2018 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoggingMiddleware

func LoggingMiddleware(next http.Handler) http.Handler

LoggingMiddleware logs the URI, Method, and time of your request

func RecoveryMiddleware

func RecoveryMiddleware(next http.Handler) http.Handler

RecoveryMiddleware recovers from panics thrown in your handlers by sending a 500 back with an error

Types

type Handler

type Handler struct {
	DB  *db.DB
	Job processors.Job
}

func (*Handler) CreateJob

func (h *Handler) CreateJob(w http.ResponseWriter, r *http.Request)

CreateJob takes a createJobRequest and enqueues the job for processing.

func (*Handler) HealthHandler

func (h *Handler) HealthHandler(w http.ResponseWriter, r *http.Request)

HealthHandler returns a 200 if the service is healthy and a 500 if it is not

func (*Handler) ListJobs

func (h *Handler) ListJobs(w http.ResponseWriter, r *http.Request)

ListJobs returns a list of all the jobs in the system

type Response

type Response struct {
	Meta     map[string]string `json:"meta"`
	Response interface{}       `json:"response"`
}

Jump to

Keyboard shortcuts

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