Documentation ¶
Index ¶
- Constants
- func NewJSONRequest(method, url string, header http.Header, jo interface{}) (*http.Request, error)
- type Client
- func (c *Client) Do(ctx context.Context, req *http.Request) (*http.Response, error)
- func (c *Client) GetJSON(ctx context.Context, url string, params url.Values, header http.Header, ...) error
- func (c *Client) JSON(ctx context.Context, req *http.Request, res interface{}) error
- func (c *Client) PostForm(ctx context.Context, url string, params url.Values, header http.Header, ...) error
- func (c *Client) PostJSON(ctx context.Context, url string, params url.Values, header http.Header, ...) error
- type ClientConfig
- type Server
- type ServerOption
Constants ¶
View Source
const ( HeaderUserAgent = "User-Agent" HeaderContentType = "Content-Type" )
View Source
const ( ContentTypeJSON = "application/json" ContentTypeForm = "application/x-www-form-urlencoded" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(cfg ClientConfig) *Client
type ClientConfig ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(opts ...ServerOption) *Server
type ServerOption ¶
type ServerOption func(o *Server)
func WithAddress ¶
func WithAddress(addr string) ServerOption
func WithTLS ¶
func WithTLS(certPath, keyPath string) ServerOption
Click to show internal directories.
Click to hide internal directories.