ctx

package
v0.0.0-...-828e842 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2015 License: MIT Imports: 6 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	AuthDb                     *datastores.AuthDatastore
	StorageDb                  *datastores.StorageDatastore
	Queue                      *queues.RabbitMQConnection
	JSONTrackingEventValidator *validators.JSONEventTrackingValidator
	Logger                     *logrus.Logger
}

Context a context that holds database and queue connections

func NewContext

NewContext returns a new context from arguments

type FinalHandler

type FinalHandler struct {
	Context *Context
	Payload []byte
	Handle  func(*Context, []byte, http.ResponseWriter, *http.Request)
}

FinalHandler a final http handler that holds the request's payload

func NewFinalHandler

func NewFinalHandler(c *Context, p []byte, f func(c *Context, p []byte, w http.ResponseWriter, r *http.Request)) *FinalHandler

NewFinalHandler returns a new FinalHandler from arguments

func (FinalHandler) ServeHTTP

func (fh FinalHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Handler

type Handler struct {
	Context *Context
	Handle  func(*Context, http.ResponseWriter, *http.Request)
}

Handler an http handler that holds the application context

func NewHandler

func NewHandler(c *Context, f func(c *Context, w http.ResponseWriter, r *http.Request)) *Handler

NewHandler returns a new Handler from arguments

func (Handler) ServeHTTP

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

Jump to

Keyboard shortcuts

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