Documentation ¶
Index ¶
- type Client
- func (c *Client) Do(req *http.Request) (resp *http.Response, err error)
- func (c *Client) Get(ctx context.Context, url string) (resp *http.Response, err error)
- func (c *Client) NewRequest(ctx context.Context, method, url string, body io.Reader) (*http.Request, error)
- func (c *Client) Transport() (transport http.RoundTripper)
- type Module
- type ResponseWriter
- type Server
- func (s *Server) HandleFunc(path string, f func(http.ResponseWriter, *http.Request)) *mux.Route
- func (s *Server) MiddlewareMetrics(next http.Handler) http.Handler
- func (s *Server) PathPrefix(path string) *mux.Route
- func (s *Server) Start() error
- func (s *Server) Stop(ctx context.Context) error
- func (s *Server) WrapInMiddlewares(h http.Handler) http.Handler
- type Transport
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) NewRequest ¶
func (c *Client) NewRequest(ctx context.Context, method, url string, body io.Reader) (*http.Request, error)
NewRequest calls http.NewRequest with expected http User-Agent.
func (*Client) Transport ¶
func (c *Client) Transport() (transport http.RoundTripper)
type ResponseWriter ¶
type ResponseWriter struct { http.ResponseWriter // contains filtered or unexported fields }
ResponseWriter is a ResponseWriter that keeps track of status and body size
func NewResponseWriter ¶
func NewResponseWriter(w http.ResponseWriter) *ResponseWriter
NewResponseWriter creates a new ResponseWriter
func (*ResponseWriter) BodyLength ¶
func (r *ResponseWriter) BodyLength() int
BodyLength returns the response body length
func (*ResponseWriter) Status ¶
func (r *ResponseWriter) Status() int
Status returns the status code of the response
func (*ResponseWriter) Write ¶
func (r *ResponseWriter) Write(b []byte) (int, error)
Write to the response writer, also updating body length
func (*ResponseWriter) WriteHeader ¶
func (r *ResponseWriter) WriteHeader(status int)
WriteHeader sets the status of the response
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is a http 2 web server
func (*Server) HandleFunc ¶
HandleFunc attaches a function to a path
func (*Server) MiddlewareMetrics ¶
func (*Server) PathPrefix ¶
PathPrefix attaches a new route url path prefix
Source Files ¶
Click to show internal directories.
Click to hide internal directories.