Versions in this module Expand all Collapse all v1 v1.0.2 Mar 18, 2026 v1.0.1 Mar 5, 2026 Changes in this version + const FormUrlHeader + const JsonHeader + const MethodGet + const MethodPost + const MethodPut + func CreateHTTPClient(c config.HttpConf) *http.Client + func GenerateRequest(ctx context.Context, method, url string, reqData any) (request *http.Request, err error) + func SetBasicAuth(username, password string) map[string]string + func SetBeautify(flag bool) + func SetBreaker(flag bool) + func SetDisableLogDetail(flag bool) + func SetHttpClient(httpClient *http.Client) + func SetHttpConf(httpConf config.HttpConf) + func SetLogDetail(flag bool) + func SetMaxBodyLen(max int) + func SetPromConf(conf PromConf) + func SetSlowThreshold(d int) + type Option func(o *options) + func WithBreakerName(name string) Option + func WithHeader(header map[string]string) Option + func WithLabels(labels []string) Option + func WithNeedDuration(flag bool) Option + func WithOnlyInterfaceDuration(flag bool) Option + func WithParseResp(respData any) Option + func WithParseRespBody(flag bool) Option + func WithRequest(request *http.Request) Option + func WithTimeout(timeout int) Option + func WithTmpLogDetail(flag bool) Option + type PromConf struct + Enable bool + Host string + Path string + Port int + type Response struct + Duration time.Duration + func Do(ctx context.Context, method, url string, reqData any, option ...Option) (result *Response, err error)