job

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2018 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrInternalError

func ErrInternalError(err error) render.Renderer

ErrInternalError return internal error

func ErrInvalidRequest

func ErrInvalidRequest(err error) render.Renderer

ErrInvalidRequest return an invalid http request

func ErrNotFound

func ErrNotFound(err error) render.Renderer

ErrNotFound return a not found error

func Routes

func Routes(db *mgo.Database) *chi.Mux

Routes Route handlers for jobs

Types

type AuthCtxKey added in v0.9.0

type AuthCtxKey string

AuthCtxKey context key for authentication state & policy map

type ErrResponse

type ErrResponse struct {
	Err            error `json:"-"` // low-level runtime error
	HTTPStatusCode int   `json:"-"` // http response status code

	StatusText string `json:"status"`          // user-level status message
	AppCode    int64  `json:"code,omitempty"`  // application-specific error code
	ErrorText  string `json:"error,omitempty"` // application-level error message, for debugging
}

ErrResponse struct for http error responses

func (*ErrResponse) Render

func (e *ErrResponse) Render(w http.ResponseWriter, r *http.Request) error

Render to render a http return code

type JobRequest

type JobRequest jobqueues.Job // nolint

JobRequest localises jobqueues.Job in this module

func (*JobRequest) Bind

func (j *JobRequest) Bind(req *http.Request) error

Bind Binder of decoded request payload

type JobRouter

type JobRouter struct {
	Db *mgo.Database
}

JobRouter holds config state, e.g. the handle for the database

Jump to

Keyboard shortcuts

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