Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewLoggingMiddleware ¶ added in v0.4.0
NewLoggingMiddleware returns a middleware for logging requests
Types ¶
type Handler ¶
Handler represents a basic REST handler
func NewHandler ¶
func NewHandler(logger abstraction.Logger, handlerName string) *Handler
NewHandler returns a new basic REST handler instance
func (Handler) DecodeFromJSON ¶ added in v0.4.0
DecodeFromJSON obtains a value from the body of the request
func (Handler) RespondWithError ¶
func (h Handler) RespondWithError(w http.ResponseWriter, code int, message string)
RespondWithError sends an error response in JSON Format
func (Handler) RespondWithJSON ¶
func (h Handler) RespondWithJSON(w http.ResponseWriter, code int, payload interface{})
RespondWithJSON sends a response in RespondWithJSON Format
type Settings ¶ added in v0.4.0
type Settings struct { Address string ReadTimeout time.Duration WriteTimeout time.Duration GracefulTimeout time.Duration }
Settings contains the configuration values for the AppServer
func DefaultSettings ¶ added in v0.4.0
func DefaultSettings() *Settings
DefaultSettings provides the default settings for a server
Click to show internal directories.
Click to hide internal directories.