middleware

package
v0.0.0-...-cea2754 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2016 License: MIT Imports: 8 Imported by: 4

Documentation

Index

Constants

View Source
const (
	RequestIDKey     = "request-id"
	StatusCodeKey    = "status-code"
	DBKey            = "db"
	ResponseDataKey  = "response-data"
	ResponseErrorKey = "response-error"
	ResponseKey      = "response"
	RequestDataKey   = "request-data"
	CaptchaResult    = "captcha-result"
)

Variables

This section is empty.

Functions

func RequestIdentifier

func RequestIdentifier(c siesta.Context, w http.ResponseWriter, r *http.Request)

func ResponseGenerator

func ResponseGenerator(c siesta.Context, w http.ResponseWriter, r *http.Request)

func ResponseWriter

func ResponseWriter(c siesta.Context, w http.ResponseWriter, r *http.Request,
	quit func())

Types

type APIResponse

type APIResponse struct {
	Data  interface{} `json:"data,omitempty"`
	Error string      `json:"error,omitempty"`
}

type RequestData

type RequestData struct {
	RequestID     string
	StatusCode    int
	DB            *sql.DB
	ResponseData  interface{}
	ResponseError string
	Response      interface{}
	Start         time.Time
}

Jump to

Keyboard shortcuts

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