http_request

package
v2.1.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 13, 2023 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AliyunLog added in v2.0.10

type AliyunLog struct {
	// contains filtered or unexported fields
}

func NewAliyunLog added in v2.0.10

func NewAliyunLog(topic string) *AliyunLog

func (*AliyunLog) Info added in v2.0.10

func (l *AliyunLog) Info(obj *LogObject) error

使用阿里云日志需要提前调用sls.InitLog初始化

type GocoreLog added in v2.0.10

type GocoreLog struct {
}

func NewGocoreLog added in v2.0.10

func NewGocoreLog() *GocoreLog

func (*GocoreLog) Info added in v2.0.10

func (l *GocoreLog) Info(obj *LogObject) error

type HttpClient

type HttpClient struct {
	Client  *resty.Client
	Request *resty.Request
}

func New

func New() *HttpClient

func (*HttpClient) SetLog added in v2.0.10

func (h *HttpClient) SetLog(log Log) *HttpClient

func (*HttpClient) SetTrace

func (h *HttpClient) SetTrace(header interface{}) *HttpClient

type Log added in v2.0.10

type Log interface {
	Info(obj *LogObject) error
}

type LogObject added in v2.0.10

type LogObject struct {
	Url             string        `json:"url"`
	Method          string        `json:"method"`
	RequestHders    http.Header   `json:"request_headers"`
	RequestRawBody  interface{}   `json:"request_raw_body"`
	ResponseHeaders http.Header   `json:"response_headers"`
	ResponseBody    string        `json:"response_body"`
	StartTime       string        `json:"start_time"`
	Duration        time.Duration `json:"duration"`
	Status          int           `json:"status"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL