Documentation
¶
Overview ¶
clientUtil is a thin wrapper over http.Client and net.* to provide different timeout,number of retries,time to wait between each retry for each http and net request.
Index ¶
- func Dial(dialer *net.Dialer, network, address string, reqInfo *RequestInfo) (net.Conn, error)
- func DialContext(dialer *net.Dialer, network, address string, reqInfo *RequestInfo) (net.Conn, error)
- func DialIP(network, address string, reqInfo *RequestInfo) (*net.IPConn, error)
- func DialTCP(network, address string, reqInfo *RequestInfo) (*net.TCPConn, error)
- func DialTimeout(network, address string, reqInfo *RequestInfo) (net.Conn, error)
- func DialUDP(network, address string, reqInfo *RequestInfo) (*net.UDPConn, error)
- func DialUnix(network, address string, reqInfo *RequestInfo) (*net.UnixConn, error)
- func HttpDo(r *http.Request, reqInfo *RequestInfo) ([]byte, error)
- func HttpGet(url string, reqInfo *RequestInfo) ([]byte, error)
- func HttpHead(url string, reqInfo *RequestInfo) ([]byte, error)
- func HttpNewRequest(method string, url string, body io.Reader) (*http.Request, error)
- func HttpPost(url string, contentType string, body io.Reader, reqInfo *RequestInfo) ([]byte, error)
- func HttpPostForm(url string, data url.Values, reqInfo *RequestInfo) ([]byte, error)
- func LookupAddr(resolver *net.Resolver, addr string, reqInfo *RequestInfo) (names []string, err error)
- func LookupCNAME(resolver *net.Resolver, host string, reqInfo *RequestInfo) (cname string, err error)
- func LookupHost(resolver *net.Resolver, host string, reqInfo *RequestInfo) (addrs []string, err error)
- func LookupIPAddr(resolver *net.Resolver, host string, reqInfo *RequestInfo) ([]net.IPAddr, error)
- func LookupMX(resolver *net.Resolver, name string, reqInfo *RequestInfo) ([]*net.MX, error)
- func LookupNS(resolver *net.Resolver, name string, reqInfo *RequestInfo) ([]*net.NS, error)
- func LookupPort(resolver *net.Resolver, network, service string, reqInfo *RequestInfo) (port int, err error)
- func LookupSRV(resolver *net.Resolver, service, proto, name string, reqInfo *RequestInfo) (cname string, addrs []*net.SRV, err error)
- func LookupTXT(resolver *net.Resolver, name string, reqInfo *RequestInfo) ([]string, error)
- func NewSmtpClient(network, address string, reqInfo *RequestInfo) (*smtp.Client, error)
- type RequestInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Dial ¶
Dial. call Go net.Dial underlying but with the retry feature based on the passed in reqInfo parameter.
func DialContext ¶
func DialContext(dialer *net.Dialer, network, address string, reqInfo *RequestInfo) (net.Conn, error)
DialContext. call Go net.DialContext underlying but with the retry feature based on the passed in reqInfo parameter.
func DialIP ¶
func DialIP(network, address string, reqInfo *RequestInfo) (*net.IPConn, error)
DialIP. call Go net.DialContext underlying but with the retry feature based on the passed in reqInfo parameter.
func DialTCP ¶
func DialTCP(network, address string, reqInfo *RequestInfo) (*net.TCPConn, error)
DialTCP. call Go net.DialContext underlying but with the retry feature based on the passed in reqInfo parameter.
func DialTimeout ¶
func DialTimeout(network, address string, reqInfo *RequestInfo) (net.Conn, error)
DialTimeout. call Go net.DialTimeout underlying but with the retry feature based on the passed in reqInfo parameter.
func DialUDP ¶
func DialUDP(network, address string, reqInfo *RequestInfo) (*net.UDPConn, error)
DialUDP. call Go net.DialContext underlying but with the retry feature based on the passed in reqInfo parameter.
func DialUnix ¶
func DialUnix(network, address string, reqInfo *RequestInfo) (*net.UnixConn, error)
DialUnix. call Go net.DialContext underlying but with the retry feature based on the passed in reqInfo parameter.
func HttpDo ¶
func HttpDo(r *http.Request, reqInfo *RequestInfo) ([]byte, error)
HttpDo. call Go client.Do underlying but with the retry feature based on the passed in reqInfo parameter.
func HttpGet ¶
func HttpGet(url string, reqInfo *RequestInfo) ([]byte, error)
HttpGet. call Go client.Get underlying but with the retry feature based on the passed in reqInfo parameter.
func HttpHead ¶
func HttpHead(url string, reqInfo *RequestInfo) ([]byte, error)
HttpHead. call Go client.Head underlying but with the retry feature based on the passed in reqInfo parameter.
func HttpNewRequest ¶
HttpNewRequest. call Go http.NewRequest underlying
func HttpPost ¶
HttpPost. call Go client.Post underlying but with the retry feature based on the passed in reqInfo parameter.
func HttpPostForm ¶
HttpPostForm. call Go client.PostForm underlying but with the retry feature based on the passed in reqInfo parameter.
func LookupAddr ¶
func LookupAddr(resolver *net.Resolver, addr string, reqInfo *RequestInfo) (names []string, err error)
LookupAddr. call Go resolver.LookupAddr underlying but with the retry feature based on the passed in reqInfo parameter.
func LookupCNAME ¶
func LookupCNAME(resolver *net.Resolver, host string, reqInfo *RequestInfo) (cname string, err error)
LookupCNAME. call Go resolver.LookupCNAME underlying but with the retry feature based on the passed in reqInfo parameter.
func LookupHost ¶
func LookupHost(resolver *net.Resolver, host string, reqInfo *RequestInfo) (addrs []string, err error)
LookupHost. call Go resolver.LookupHost underlying but with the retry feature based on the passed in reqInfo parameter.
func LookupIPAddr ¶
LookupIPAddr. call Go resolver.LookupIPAddr underlying but with the retry feature based on the passed in reqInfo parameter.
func LookupMX ¶
LookupMX. call Go resolver.LookupMX underlying but with the retry feature based on the passed in reqInfo parameter.
func LookupNS ¶
LookupNS. call Go resolver.LookupNS underlying but with the retry feature based on the passed in reqInfo parameter.
func LookupPort ¶
func LookupPort(resolver *net.Resolver, network, service string, reqInfo *RequestInfo) (port int, err error)
LookupPort. call Go resolver.LookupPort underlying but with the retry feature based on the passed in reqInfo parameter.
func LookupSRV ¶
func LookupSRV(resolver *net.Resolver, service, proto, name string, reqInfo *RequestInfo) (cname string, addrs []*net.SRV, err error)
LookupSRV. call Go resolver.LookupSRV underlying but with the retry feature based on the passed in reqInfo parameter.
func LookupTXT ¶
LookupTXT. call Go resolver.LookupTXT underlying but with the retry feature based on the passed in reqInfo parameter.
func NewSmtpClient ¶
func NewSmtpClient(network, address string, reqInfo *RequestInfo) (*smtp.Client, error)
NewSmtpClient. call Go net.Dial follow by smtp.NewClient underlying but with the retry feature based on the passed in reqInfo parameter.
Types ¶
type RequestInfo ¶
RequestInfo is the struct to store the information for doing retry.