请求配置验证, 默认值初始化 + full_url + method验证

This commit is contained in:
2024-05-31 16:39:58 +08:00
parent c977bc0392
commit 2be9c90b79
6 changed files with 293 additions and 12 deletions

17
define/error.go Normal file
View File

@ -0,0 +1,17 @@
// Package define ...
//
// Description : define ...
//
// Author : go_developer@163.com<白茶清欢>
//
// Date : 2024-05-31 16:02
package define
import "errors"
var (
ErrRequestConfigNil = errors.New("REQUEST_CONFIG_NIL") // 请求配置 nil
ErrFullUrlEmpty = errors.New("FULL_URL_EMPTY") // 没传 full_url
ErrFullUrlInvalid = errors.New("FULL_URL_Invalid") // 请求 full_url 不是 http 或者 https 开头
ErrMethodIsNotSupport = errors.New("METHOD_IS_NOT_SUPPORT") // 请求 method不支持
)