Documentation
¶
Index ¶
- func BasicAuth(username, passwd string) string
- func CanonicalHost(host string) (string, error)
- func MakeHTTPHandlerFunc(handler APIHandler) http.HandlerFunc
- func NewRequestLogger(next http.Handler) http.Handler
- func OkResponse() *http.Response
- func ParseBasicAuth(auth string) (username, password string, ok bool)
- func ProxyUnauthorizedResponse() *http.Response
- type APIHandler
- type Context
- type Error
- type GeneralResponse
- type RouterRegisterHelper
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CanonicalHost ¶
canonicalHost strips port from host if present and returns the canonicalized host name.
func MakeHTTPHandlerFunc ¶ added in v0.67.0
func MakeHTTPHandlerFunc(handler APIHandler) http.HandlerFunc
MakeHTTPHandlerFunc turns a normal APIHandler into a http.HandlerFunc.
func OkResponse ¶
func ParseBasicAuth ¶
Types ¶
type APIHandler ¶ added in v0.67.0
APIHandler is a handler function that returns a response object or an error.
type Context ¶ added in v0.67.0
type Context struct {
Req *http.Request
Resp http.ResponseWriter
// contains filtered or unexported fields
}
func NewContext ¶ added in v0.67.0
func NewContext(w http.ResponseWriter, r *http.Request) *Context
type GeneralResponse ¶ added in v0.67.0
type RouterRegisterHelper ¶
type RouterRegisterHelper struct {
Router *mux.Router
AssetsFS http.FileSystem
AuthMiddleware mux.MiddlewareFunc
}
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) RouteRegister ¶
func (s *Server) RouteRegister(register func(helper *RouterRegisterHelper))
Click to show internal directories.
Click to hide internal directories.