Documentation
¶
Index ¶
- type Option
- type Router
- func (rt *Router) Client() *http.Client
- func (rt *Router) Close()
- func (rt *Router) DefaultHeader(key, value string)
- func (rt *Router) DefaultMiddleware(mw func(next http.HandlerFunc) http.HandlerFunc)
- func (rt *Router) Match(fn func(r *http.Request) bool) *matcher
- func (rt *Router) Method(method string) *matcher
- func (rt *Router) Path(path string) *matcher
- func (rt *Router) Requests() []*http.Request
- func (rt *Router) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (rt *Router) Server() *httptest.Server
- func (rt *Router) TLSServer() *httptest.Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶ added in v0.4.0
type Option func(*config) error
func Certificates ¶ added in v0.4.1
Certificates set certificates ( cert, key )
func ClientCACert ¶ added in v0.5.0
ClientCACert set client CA
func ClientCertificates ¶ added in v0.5.0
ClientCertificates set client certificates ( cert, key )
func UseTLSWithCertificates ¶ added in v0.4.0
UseTLSWithCertificates enable TLS with certificates ( cert, key )
type Router ¶ added in v0.3.0
type Router struct {
// contains filtered or unexported fields
}
func NewTLSServer ¶ added in v0.4.0
NewTLSServer returns a new router including TLS *httptest.Server.
func (*Router) Client ¶ added in v0.3.0
Client returns *http.Client which requests *httptest.Server.
func (*Router) DefaultHeader ¶ added in v0.3.0
DefaultHeader append default middleware which append header.
func (*Router) DefaultMiddleware ¶ added in v0.3.0
func (rt *Router) DefaultMiddleware(mw func(next http.HandlerFunc) http.HandlerFunc)
DefaultMiddleware append default middleware.
func (*Router) Match ¶ added in v0.3.0
Match create request matcher with matchFunc (func(r *http.Request) bool).
func (*Router) ServeHTTP ¶ added in v0.3.0
func (rt *Router) ServeHTTP(w http.ResponseWriter, r *http.Request)
Click to show internal directories.
Click to hide internal directories.