Versions in this module Expand all Collapse all v0 v0.0.1 May 24, 2021 Changes in this version + var CloseFileFailed = berror.DefineCode(5001004, moduleName, "CloseFileFailed", ...) + var CopyFileFailed = berror.DefineCode(5001003, moduleName, "CopyFileFailed", ...) + var CreateFileIfNotExistFailed = berror.DefineCode(5001007, moduleName, "CreateFileIfNotExist", ...) + var CreateFormFileFailed = berror.DefineCode(5001001, moduleName, "CreateFormFileFailed", ...) + var InvalidJSONBody = berror.DefineCode(4001006, moduleName, "InvalidJSONBody", ...) + var InvalidUrl = berror.DefineCode(4001001, moduleName, "InvalidUrl", ...) + var InvalidUrlProtocolVersion = berror.DefineCode(4001002, moduleName, "InvalidUrlProtocolVersion", ...) + var InvalidXMLBody = berror.DefineCode(4001004, moduleName, "InvalidXMLBody", ...) + var InvalidYAMLBody = berror.DefineCode(4001005, moduleName, "InvalidYAMLBody", ...) + var ReadFileFailed = berror.DefineCode(5001002, moduleName, "ReadFileFailed", ...) + var ReadGzipBodyFailed = berror.DefineCode(5001006, moduleName, "BuildGzipReaderFailed", ...) + var SendRequestFailed = berror.DefineCode(5001005, moduleName, "SendRequestRetryExhausted", ...) + var UnmarshalJSONResponseToObjectFailed = berror.DefineCode(5001008, moduleName, "UnmarshalResponseToObjectFailed", ...) + var UnmarshalXMLResponseToObjectFailed = berror.DefineCode(5001009, moduleName, "UnmarshalResponseToObjectFailed", ...) + var UnmarshalYAMLResponseToObjectFailed = berror.DefineCode(5001010, moduleName, "UnmarshalResponseToObjectFailed", ...) + var UnsupportedBodyType = berror.DefineCode(4001003, moduleName, "UnsupportedBodyType", ...) + func AddDefaultFilter(fc FilterChain) + func NewHttpResponseWithJsonBody(data interface{}) *http.Response + func SetDefaultSetting(setting BeegoHTTPSettings) + func TimeoutDialer(cTimeout time.Duration, rwTimeout time.Duration) func(net, addr string) (c net.Conn, err error) + func TimeoutDialerCtx(cTimeout time.Duration, rwTimeout time.Duration) func(ctx context.Context, net, addr string) (c net.Conn, err error) + type BeegoHTTPRequest struct + func Delete(url string) *BeegoHTTPRequest + func Get(url string) *BeegoHTTPRequest + func Head(url string) *BeegoHTTPRequest + func NewBeegoRequest(rawurl, method string) *BeegoHTTPRequest + func Post(url string) *BeegoHTTPRequest + func Put(url string) *BeegoHTTPRequest + func (b *BeegoHTTPRequest) AddFilters(fcs ...FilterChain) *BeegoHTTPRequest + func (b *BeegoHTTPRequest) Body(data interface{}) *BeegoHTTPRequest + func (b *BeegoHTTPRequest) Bytes() ([]byte, error) + func (b *BeegoHTTPRequest) DoRequest() (resp *http.Response, err error) + func (b *BeegoHTTPRequest) DoRequestWithCtx(ctx context.Context) (resp *http.Response, err error) + func (b *BeegoHTTPRequest) GetRequest() *http.Request + func (b *BeegoHTTPRequest) Header(key, value string) *BeegoHTTPRequest + func (b *BeegoHTTPRequest) JSONBody(obj interface{}) (*BeegoHTTPRequest, error) + func (b *BeegoHTTPRequest) Param(key, value string) *BeegoHTTPRequest + func (b *BeegoHTTPRequest) PostFile(formname, filename string) *BeegoHTTPRequest + func (b *BeegoHTTPRequest) Response() (*http.Response, error) + func (b *BeegoHTTPRequest) Retries(times int) *BeegoHTTPRequest + func (b *BeegoHTTPRequest) RetryDelay(delay time.Duration) *BeegoHTTPRequest + func (b *BeegoHTTPRequest) SetBasicAuth(username, password string) *BeegoHTTPRequest + func (b *BeegoHTTPRequest) SetCheckRedirect(redirect func(req *http.Request, via []*http.Request) error) *BeegoHTTPRequest + func (b *BeegoHTTPRequest) SetCookie(cookie *http.Cookie) *BeegoHTTPRequest + func (b *BeegoHTTPRequest) SetEnableCookie(enable bool) *BeegoHTTPRequest + func (b *BeegoHTTPRequest) SetFilters(fcs ...FilterChain) *BeegoHTTPRequest + func (b *BeegoHTTPRequest) SetHost(host string) *BeegoHTTPRequest + func (b *BeegoHTTPRequest) SetProtocolVersion(vers string) *BeegoHTTPRequest + func (b *BeegoHTTPRequest) SetProxy(proxy func(*http.Request) (*url.URL, error)) *BeegoHTTPRequest + func (b *BeegoHTTPRequest) SetTLSClientConfig(config *tls.Config) *BeegoHTTPRequest + func (b *BeegoHTTPRequest) SetTimeout(connectTimeout, readWriteTimeout time.Duration) *BeegoHTTPRequest + func (b *BeegoHTTPRequest) SetTransport(transport http.RoundTripper) *BeegoHTTPRequest + func (b *BeegoHTTPRequest) SetUserAgent(useragent string) *BeegoHTTPRequest + func (b *BeegoHTTPRequest) Setting(setting BeegoHTTPSettings) *BeegoHTTPRequest + func (b *BeegoHTTPRequest) String() (string, error) + func (b *BeegoHTTPRequest) ToFile(filename string) error + func (b *BeegoHTTPRequest) ToJSON(v interface{}) error + func (b *BeegoHTTPRequest) ToXML(v interface{}) error + func (b *BeegoHTTPRequest) ToYAML(v interface{}) error + func (b *BeegoHTTPRequest) XMLBody(obj interface{}) (*BeegoHTTPRequest, error) + func (b *BeegoHTTPRequest) YAMLBody(obj interface{}) (*BeegoHTTPRequest, error) + type BeegoHTTPSettings struct + CheckRedirect func(req *http.Request, via []*http.Request) error + ConnectTimeout time.Duration + EnableCookie bool + FilterChains []FilterChain + Gzip bool + Proxy func(*http.Request) (*url.URL, error) + ReadWriteTimeout time.Duration + Retries int + RetryDelay time.Duration + TLSClientConfig *tls.Config + Transport http.RoundTripper + UserAgent string + type Filter func(ctx context.Context, req *BeegoHTTPRequest) (*http.Response, error) + type FilterChain func(next Filter) Filter