Documentation
¶
Index ¶
- Constants
- 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 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
- type Response
Constants ¶
View Source
const ( MethodGet = "GET" MethodPost = "POST" MethodPut = "PUT" JsonHeader = "application/json;charset=UTF-8" FormUrlHeader = "application/x-www-form-urlencoded" )
Variables ¶
This section is empty.
Functions ¶
func GenerateRequest ¶
func SetBasicAuth ¶
func SetBeautify ¶
func SetBeautify(flag bool)
func SetBreaker ¶
func SetBreaker(flag bool)
func SetDisableLogDetail ¶
func SetDisableLogDetail(flag bool)
func SetHttpClient ¶
func SetHttpConf ¶
func SetLogDetail ¶
func SetLogDetail(flag bool)
func SetMaxBodyLen ¶
func SetMaxBodyLen(max int)
func SetPromConf ¶
func SetPromConf(conf PromConf)
func SetSlowThreshold ¶
func SetSlowThreshold(d int)
Types ¶
type Option ¶
type Option func(o *options)
func WithBreakerName ¶
func WithHeader ¶
func WithLabels ¶
func WithNeedDuration ¶
func WithParseResp ¶
func WithParseRespBody ¶
func WithRequest ¶
func WithTimeout ¶
func WithTmpLogDetail ¶
Click to show internal directories.
Click to hide internal directories.