Documentation ¶
Index ¶
- func CompressHandler(h http.Handler) http.Handler
- func Decorate(f APIHandler, ds ...Decorator) httprouter.Handle
- func GetTopicChannelArgs(rp getter) (string, string, error)
- func LogMethodNotAllowedHandler(l app.Logger) http.Handler
- func LogNotFoundHandler(l app.Logger) http.Handler
- func LogPanicHandler(l app.Logger) func(w http.ResponseWriter, req *http.Request, p interface{})
- func NewDeadlineTransport(connectTimeout time.Duration, requestTimeout time.Duration) *http.Transport
- func RespondV1(w http.ResponseWriter, code int, data interface{})
- func Serve(listener net.Listener, handler http.Handler, proto string, l app.Logger)
- type APIHandler
- type Client
- type Decorator
- type Err
- type ReqParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompressHandler ¶ added in v0.3.6
CompressHandler gzip compresses HTTP responses for clients that support it via the 'Accept-Encoding' header.
func Decorate ¶ added in v0.3.6
func Decorate(f APIHandler, ds ...Decorator) httprouter.Handle
func GetTopicChannelArgs ¶
func LogMethodNotAllowedHandler ¶ added in v0.3.6
func LogPanicHandler ¶ added in v0.3.6
func NewDeadlineTransport ¶
func NewDeadlineTransport(connectTimeout time.Duration, requestTimeout time.Duration) *http.Transport
A custom http.Transport with support for deadline timeouts
func RespondV1 ¶
func RespondV1(w http.ResponseWriter, code int, data interface{})
Types ¶
type APIHandler ¶ added in v0.3.6
type APIHandler func(http.ResponseWriter, *http.Request, httprouter.Params) (interface{}, error)
func PlainText ¶ added in v0.3.6
func PlainText(f APIHandler) APIHandler
func V1 ¶ added in v0.3.6
func V1(f APIHandler) APIHandler
type Client ¶ added in v0.3.6
type Client struct {
// contains filtered or unexported fields
}
type Decorator ¶ added in v0.3.6
type Decorator func(APIHandler) APIHandler
Click to show internal directories.
Click to hide internal directories.