Documentation ¶
Index ¶
- Variables
- func MustCode200(cli *resty.Client, resp *resty.Response) error
- type AliyunLog
- type GocoreLog
- type HttpClient
- func (h *HttpClient) SetDisableBreaker(disable bool) *HttpClient
- func (h *HttpClient) SetDisableLog(disable bool) *HttpClient
- func (h *HttpClient) SetDisableMetrics(disable bool) *HttpClient
- func (h *HttpClient) SetLog(log Log) *HttpClient
- func (h *HttpClient) SetMaxShowBodySize(bodySize int64) *HttpClient
- func (h *HttpClient) SetReqBodyLogsWithPath(paths []string) *HttpClient
- func (h *HttpClient) SetRespBodyLogsWithPath(paths []string) *HttpClient
- func (h *HttpClient) SetSlowThresholdMs(threshold int64) *HttpClient
- func (h *HttpClient) SetTrace(header interface{}) *HttpClient
- type Log
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrIncorrectCode = errors.New("incorrect http status")
ErrIncorrectCode 非2xx 状态码
Functions ¶
func MustCode200 ¶ added in v2.1.18
func MustCode200(cli *resty.Client, resp *resty.Response) error
MustCode200 将非200的状态码认为错误的(注意:设置 SetDoNotParseResponse 后不会触发任何middware包括这个)
Types ¶
type AliyunLog ¶ added in v2.0.10
type AliyunLog struct {
// contains filtered or unexported fields
}
func NewAliyunLog ¶ added in v2.0.10
type GocoreLog ¶ added in v2.0.10
type GocoreLog struct { }
func NewGocoreLog ¶ added in v2.0.10
func NewGocoreLog() *GocoreLog
type HttpClient ¶
type HttpClient struct { Client *resty.Client Request *resty.Request // contains filtered or unexported fields }
func New ¶
func New() *HttpClient
func (*HttpClient) SetDisableBreaker ¶ added in v2.1.18
func (h *HttpClient) SetDisableBreaker(disable bool) *HttpClient
func (*HttpClient) SetDisableLog ¶ added in v2.1.18
func (h *HttpClient) SetDisableLog(disable bool) *HttpClient
func (*HttpClient) SetDisableMetrics ¶ added in v2.1.18
func (h *HttpClient) SetDisableMetrics(disable bool) *HttpClient
func (*HttpClient) SetLog ¶ added in v2.0.10
func (h *HttpClient) SetLog(log Log) *HttpClient
func (*HttpClient) SetMaxShowBodySize ¶ added in v2.1.40
func (h *HttpClient) SetMaxShowBodySize(bodySize int64) *HttpClient
func (*HttpClient) SetReqBodyLogsWithPath ¶ added in v2.1.20
func (h *HttpClient) SetReqBodyLogsWithPath(paths []string) *HttpClient
func (*HttpClient) SetRespBodyLogsWithPath ¶ added in v2.1.20
func (h *HttpClient) SetRespBodyLogsWithPath(paths []string) *HttpClient
func (*HttpClient) SetSlowThresholdMs ¶ added in v2.1.20
func (h *HttpClient) SetSlowThresholdMs(threshold int64) *HttpClient
func (*HttpClient) SetTrace ¶
func (h *HttpClient) SetTrace(header interface{}) *HttpClient
Click to show internal directories.
Click to hide internal directories.