Versions in this module Expand all Collapse all v1 v1.0.0 Feb 22, 2022 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 UnmarshalResponseToObjectFailed = berror.DefineCode(5001011, 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) JSONMarshal(obj interface{}) ([]byte, 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) SetEscapeHTML(isEscape 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) ToValue(value 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 BeegoHTTPRequestOption func(request *BeegoHTTPRequest) + func WithBasicAuth(basicAuth func() (string, string)) BeegoHTTPRequestOption + func WithContentType(contentType string) BeegoHTTPRequestOption + func WithCookie(cookie *http.Cookie) BeegoHTTPRequestOption + func WithFilters(fcs ...FilterChain) BeegoHTTPRequestOption + func WithHeader(key, value string) BeegoHTTPRequestOption + func WithParam(key, value string) BeegoHTTPRequestOption + func WithRetry(times int, delay time.Duration) BeegoHTTPRequestOption + func WithTimeout(connectTimeout, readWriteTimeout time.Duration) BeegoHTTPRequestOption + func WithTokenFactory(tokenFactory func() string) BeegoHTTPRequestOption + type BeegoHTTPSettings struct + CheckRedirect func(req *http.Request, via []*http.Request) error + ConnectTimeout time.Duration + EnableCookie bool + EscapeHTML 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 + func GetDefaultSetting() BeegoHTTPSettings + type Client struct + CommonOpts []BeegoHTTPRequestOption + Endpoint string + Name string + Setting BeegoHTTPSettings + func NewClient(name string, endpoint string, opts ...ClientOption) (*Client, error) + func (c *Client) Delete(value interface{}, path string, opts ...BeegoHTTPRequestOption) error + func (c *Client) Get(value interface{}, path string, opts ...BeegoHTTPRequestOption) error + func (c *Client) Head(value interface{}, path string, opts ...BeegoHTTPRequestOption) error + func (c *Client) Post(value interface{}, path string, body interface{}, ...) error + func (c *Client) Put(value interface{}, path string, body interface{}, ...) error + type ClientOption func(client *Client) + func WithCheckRedirect(redirect func(req *http.Request, via []*http.Request) error) ClientOption + func WithEnableCookie(enable bool) ClientOption + func WithEnableGzip(enable bool) ClientOption + func WithHTTPSetting(setting BeegoHTTPSettings) ClientOption + func WithProxy(proxy func(*http.Request) (*url.URL, error)) ClientOption + func WithTLSClientConfig(config *tls.Config) ClientOption + func WithTransport(transport http.RoundTripper) ClientOption + func WithUserAgent(userAgent string) ClientOption + type Filter func(ctx context.Context, req *BeegoHTTPRequest) (*http.Response, error) + type FilterChain func(next Filter) Filter + type HTTPBodyCarrier interface + SetReader func(r io.ReadCloser) + type HTTPBytesCarrier interface + SetBytes func(bytes []byte) + type HTTPHeadersCarrier interface + SetHeader func(header map[string][]string) + type HTTPResponseCarrier interface + SetHTTPResponse func(resp *http.Response) + type HTTPStatusCarrier interface + SetStatusCode func(status int) Other modules containing this package github.com/whiliang/beego-multi-schema/v2