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(logf lg.AppLogFunc) http.Handler
- func LogNotFoundHandler(logf lg.AppLogFunc) http.Handler
- func LogPanicHandler(logf lg.AppLogFunc) 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, logf lg.AppLogFunc)
- 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 LogMethodNotAllowedHandler(logf lg.AppLogFunc) http.Handler
func LogNotFoundHandler ¶ added in v0.3.6
func LogNotFoundHandler(logf lg.AppLogFunc) http.Handler
func LogPanicHandler ¶ added in v0.3.6
func LogPanicHandler(logf lg.AppLogFunc) func(w http.ResponseWriter, req *http.Request, p interface{})
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
func Log ¶ added in v0.3.6
func Log(logf lg.AppLogFunc) Decorator
Click to show internal directories.
Click to hide internal directories.