Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var NotFoundJSONHandler = withJSONResponse(func(r *http.Request) (int, interface{}) { return http.StatusNotFound, nil })
NotFoundJSONHandler returns a JSON HTTP 404 Not Found response
Functions ¶
func GetSession ¶
GetSession returns the Session for the given request
func LogActionID ¶
LogActionID sets the ActionID for the given request
func ParseJSONBody ¶
ParseJSONBody decodes the http.Request body into one or more values
Types ¶
type APIRouter ¶
type APIRouter struct {
// contains filtered or unexported fields
}
APIRouter is an API Router
func (*APIRouter) Handle ¶
func (r *APIRouter) Handle(method, path string, handler ReturnHandlerFunc, auth bool)
Handle registers a ReturnHandlerFunc with the given parameters
type AuthHookFunc ¶
AuthHookFunc is used to further check authorization of a Session and return extra attributes
type ReturnHandlerFunc ¶
ReturnHandlerFunc returns an HTTP status code and body for the given request
func WithTX ¶
func WithTX(db *sql.DB, next TXReturnHandlerFunc) ReturnHandlerFunc
WithTX returns a ReturnHandlerFunc for the given database and TXReturnHandlerFunc
Click to show internal directories.
Click to hide internal directories.