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) error
- type APIHandler
- type Client
- type Decorator
- type Err
- type ReqParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompressHandler ¶
CompressHandler gzip compresses HTTP responses for clients that support it via the 'Accept-Encoding' header.
func Decorate ¶
func Decorate(f APIHandler, ds ...Decorator) httprouter.Handle
func GetTopicChannelArgs ¶
func LogMethodNotAllowedHandler ¶
func LogMethodNotAllowedHandler(logf lg.AppLogFunc) http.Handler
func LogNotFoundHandler ¶
func LogNotFoundHandler(logf lg.AppLogFunc) http.Handler
func LogPanicHandler ¶
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 ¶
type APIHandler func(http.ResponseWriter, *http.Request, httprouter.Params) (interface{}, error)
func DtJSON ¶
func DtJSON(f APIHandler) APIHandler
func PlainText ¶
func PlainText(f APIHandler) APIHandler
func V1 ¶
func V1(f APIHandler) APIHandler
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
type Decorator ¶
type Decorator func(APIHandler) APIHandler
func Log ¶
func Log(logf lg.AppLogFunc) Decorator
Click to show internal directories.
Click to hide internal directories.