RouterAPISecret

package
v5.1.37 Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//Key值
	SimpleSendKey string
)

Functions

func CheckAPI

func CheckAPI(c *gin.Context, urlAction string, key string) error

CheckAPI 从header解析并验证密钥 必须给定secretID param c *gin.Context param urlAction string 验证的URL动作 param key string 私钥 return error

func GetSecretID

func GetSecretID(c *gin.Context) string

GetSecretID 单独获取secret_id值

func SendDelete

func SendDelete(config DataSendConfigType) ([]byte, error)

SendDelete 发起删除动作

func SendDo

func SendDo(config DataSendConfigType) ([]byte, error)

SendDo 发送请求封装 param config SendConfigType return []byte 反馈数据 return error 错误

func SendGet

func SendGet(config DataSendConfigType) ([]byte, error)

SendGet 发送get请求 不需要指定http.method动作类别

func SendPATCH

func SendPATCH(config DataSendConfigType) ([]byte, error)

SendPATCH 发起局部更新

func SendPost

func SendPost(config DataSendConfigType) ([]byte, error)

SendPost 发起post请求

func SendPut

func SendPut(config DataSendConfigType) ([]byte, error)

SendPut 发起put全量更新

func SendSimpleCheck

func SendSimpleCheck(c *gin.Context, urlAction string) error

从header解析密钥 secretID按照空值处理 key认定为GlobKey param c *gin.Context param urlAction string 验证的URL动作 return error

func SendSimpleDelete

func SendSimpleDelete(getURL string, params url.Values, action string) ([]byte, error)

发起删除动作

func SendSimpleDo

func SendSimpleDo(data DataSendConfigType) ([]byte, error)

发送请求封装 内部通用密钥调用 param data SendConfigType return []byte 反馈数据 return error 错误

func SendSimpleGet

func SendSimpleGet(getURL string, action string) ([]byte, error)

Get

func SendSimplePATCH

func SendSimplePATCH(getURL string, params url.Values, action string) ([]byte, error)

发起局部更新

func SendSimplePost

func SendSimplePost(getURL string, params url.Values, action string) ([]byte, error)

Post

func SendSimplePut

func SendSimplePut(getURL string, params url.Values, action string) ([]byte, error)

发起put全量更新

func SendSimpleToStatus

func SendSimpleToStatus(data []byte) bool

解析常用status结果集 主要用于判断动作是否完成,其他请自行根据业务逻辑解析 param data []byte 需要解析结果集 return error 错误代码

Types

type DataSendConfigType

type DataSendConfigType struct {
	//请求方法 http.Method*
	Method string
	//请求URL地址
	GetURL string
	//请求数据包
	Params interface{}
	//Action动作
	Action string
	//配对
	SecretID string
	//密钥
	Key string
	//加密方法
	SignatureMethod string
}

DataSendConfigType 请求结构体

Jump to

Keyboard shortcuts

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