Documentation ¶
Overview ¶
Package http provides a http client
Index ¶
- Variables
- func Body(b string) client.CallOption
- func Cookie(cookies ...string) client.CallOption
- func ErrorMap(m map[string]interface{}) client.CallOption
- func GetError(err error) interface{}
- func HTTPClient(c *http.Client) client.Option
- func HTTPDialer(d *net.Dialer) client.Option
- func Header(headers ...string) client.CallOption
- func MaxRecvMsgSize(s int) client.Option
- func MaxSendMsgSize(s int) client.Option
- func Metadata(md metadata.Metadata) client.CallOption
- func Method(m string) client.CallOption
- func NewClient(opts ...client.Option) *httpClient
- func Path(p string) client.CallOption
- func PoolMaxIdle(d int) client.Option
- func PoolMaxStreams(n int) client.Option
- func StructTags(tags []string) client.CallOption
- type Error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // DefaultPoolMaxStreams maximum streams on a connectioin // (20) DefaultPoolMaxStreams = 20 // DefaultPoolMaxIdle maximum idle conns of a pool // (50) DefaultPoolMaxIdle = 50 // DefaultMaxRecvMsgSize maximum message that client can receive // (4 MB). DefaultMaxRecvMsgSize = 1024 * 1024 * 4 // DefaultMaxSendMsgSize maximum message that client can send // (4 MB). DefaultMaxSendMsgSize = 1024 * 1024 * 4 )
View Source
var DefaultContentType = "application/json"
Functions ¶
func ErrorMap ¶
func ErrorMap(m map[string]interface{}) client.CallOption
func HTTPClient ¶
nolint: golint HTTPClient pass http.Client option to client Call
func HTTPDialer ¶
nolint: golint HTTPDialer pass net.Dialer option to client
func MaxRecvMsgSize ¶
MaxRecvMsgSize set the maximum size of message that client can receive.
func MaxSendMsgSize ¶
MaxSendMsgSize set the maximum size of message that client can send.
func Metadata ¶
func Metadata(md metadata.Metadata) client.CallOption
Metadata pass metadata to client Call
func PoolMaxStreams ¶
PoolMaxStreams maximum streams on a connectioin
func StructTags ¶
func StructTags(tags []string) client.CallOption
StructTags pass tags slice option to client Call
Types ¶
Click to show internal directories.
Click to hide internal directories.