Versions in this module Expand all Collapse all v0 v0.1.1 Dec 7, 2014 v0.1.0 Dec 7, 2014 Changes in this version + const DefaultLimit + const MaxBatchSize + const MaxLimit + func GetDurationField(r *http.Request, fieldName string) (time.Duration, error) + func GetIntField(r *http.Request, fieldName string) (int, error) + func GetMultipleFields(r *http.Request, fieldName string) ([]string, error) + func GetStringField(r *http.Request, fieldName string) (string, error) + func GetStringFieldWithDefault(r *http.Request, fieldName, defaultValue string) string + func GetTimestampField(r *http.Request, fieldName string) (time.Time, error) + func MakeHandler(app *App, fn HandlerFunc, spec Spec) http.HandlerFunc + func MakeHandlerWithBody(app *App, fn HandlerWithBodyFunc, spec Spec) http.HandlerFunc + func Reply(w http.ResponseWriter, response interface{}, status int) + func ReplyError(w http.ResponseWriter, err error) + func ReplyInternalError(w http.ResponseWriter, message string) + type App struct + Config AppConfig + func NewApp() *App + func NewAppWithConfig(config AppConfig) *App + func (app *App) AddHandler(spec Spec) error + func (app *App) GetHandler() http.Handler + func (app *App) IsPublicRequest(request *http.Request) bool + func (app *App) Run() error + func (app *App) SetNotFoundHandler(fn http.HandlerFunc) + type AppConfig struct + Client metrics.Client + ListenIP string + ListenPort int + Name string + ProtectedAPIHost string + ProtectedAPIURL string + PublicAPIHost string + Register bool + Router *mux.Router + type ConflictError struct + Description string + func (e ConflictError) Error() string + type GenericAPIError struct + Reason string + func (e GenericAPIError) Error() string + type HandlerFunc func(http.ResponseWriter, *http.Request, map[string]string) (interface{}, error) + type HandlerWithBodyFunc func(http.ResponseWriter, *http.Request, map[string]string, []byte) (interface{}, error) + type InvalidFormatError struct + Field string + Value string + func (e InvalidFormatError) Error() string + type InvalidParameterError struct + Field string + Value string + func (e InvalidParameterError) Error() string + type MissingFieldError struct + Field string + func (e MissingFieldError) Error() string + type NotFoundError struct + Description string + func (e NotFoundError) Error() string + type Response map[string]interface + type Scope int + const ScopeProtected + const ScopePublic + func (scope Scope) String() string + type Spec struct + Handler HandlerFunc + HandlerWithBody HandlerWithBodyFunc + Headers []string + Methods []string + MetricName string + Middlewares []middleware.Middleware + Path string + RawHandler http.HandlerFunc + Register bool + Scopes []Scope