Documentation
¶
Overview ¶
Package http provides http client and server implementations.
Package http provides http client and server implementations.
Index ¶
- type Response
- type Server
- func (this *Server) RegisterHandlerFunc(path, method string, handlerFunc http.HandlerFunc)
- func (this *Server) RegisterPathPrefixHandler(prefix string, handler http.Handler)
- func (this *Server) SetRouter(router *mux.Router)
- func (this *Server) Start(address string, listenAndServeFailureFunc func(err error), ...) error
- func (this *Server) Stop(shutdownTimeout time.Duration) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Response ¶
Response is response information.
func Request ¶
func Request(url, method string, header map[string][]string, body string, timeout time.Duration, username, password string, transport *http.Transport) (Response, error)
Request is request.
ex) response, err := http.Request("http://127.0.0.1:10000/test/id-01", http.MethodGet, map[string][]string{"header-1": {"value-1"}}, "", 10, "", "", nil)
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is a struct that provides server related methods.
func (*Server) RegisterHandlerFunc ¶ added in v1.1.6
func (this *Server) RegisterHandlerFunc(path, method string, handlerFunc http.HandlerFunc)
RegisterHandlerFunc is add handler.
ex) server.RegisterHandlerFunc("/v1/test", http.MethodPost, handler)
func (*Server) RegisterPathPrefixHandler ¶ added in v1.1.6
RegisterPathPrefixHandler is add path prefix handler.
ex) server.RegisterPathPrefixHandler("/swagger/", httpSwagger.WrapHandler)
Click to show internal directories.
Click to hide internal directories.