httpclient/define/event.go

44 lines
1.0 KiB
Go
Raw Normal View History

2024-05-31 14:57:25 +08:00
// Package define ...
//
// Description : define ...
//
// Author : go_developer@163.com<白茶清欢>
//
// Date : 2024-05-31 14:51
package define
2024-06-01 18:41:26 +08:00
// Http4xxHandler 4xx handler
2024-05-31 14:57:25 +08:00
//
// Author : go_developer@163.com<白茶清欢>
//
2024-06-01 18:41:26 +08:00
// Date : 14:54 2024/5/31
type Http4xxHandler func(req *Request, rep *Response)
2024-05-31 14:57:25 +08:00
2024-06-01 18:41:26 +08:00
// Http5xxHandler 5xx handler
2024-05-31 14:57:25 +08:00
//
2024-06-01 18:41:26 +08:00
// Author : go_developer@163.com<白茶清欢>
2024-05-31 14:57:25 +08:00
//
2024-06-01 18:41:26 +08:00
// Date : 14:55 2024/5/31
type Http5xxHandler func(req *Request, rep *Response)
2024-05-31 14:57:25 +08:00
2024-06-01 18:41:26 +08:00
// HttpBusinessErrorHandler 接口请求业务错误
2024-05-31 14:57:25 +08:00
//
// Author : go_developer@163.com<白茶清欢>
//
2024-06-01 18:41:26 +08:00
// Date : 18:04 2024/6/1
type HttpBusinessErrorHandler func(req *Request, rep *Response)
2024-05-31 14:57:25 +08:00
2024-06-01 18:41:26 +08:00
// RequestSendErrorHandler 请求发送失败的处理逻辑
2024-05-31 14:57:25 +08:00
//
// Author : go_developer@163.com<白茶清欢>
//
2024-06-01 18:41:26 +08:00
// Date : 18:23 2024/6/1
type RequestSendErrorHandler func(req *Request)
2024-05-31 14:57:25 +08:00
2024-06-01 18:41:26 +08:00
// RequestFinishHandler 请求最终完成事件, 不区分成功 OR 失败
2024-05-31 14:57:25 +08:00
//
// Author : go_developer@163.com<白茶清欢>
//
2024-06-01 18:41:26 +08:00
// Date : 18:34 2024/6/1
type RequestFinishHandler func(req *Request, rep *Response)