Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ConfigDefault = Config{ Next: nil, Except: []string{}, Key: "", Encryptor: EncryptCookie, Decryptor: DecryptCookie, }
ConfigDefault 默认配置
Functions ¶
func DecryptCookie ¶
DecryptCookie 解密 Cookie 值
func EncryptCookie ¶
EncryptCookie 加密 Cookie 值
Types ¶
type Config ¶
type Config struct {
Next func(c *kanggo.Context) bool // 可选:跳过此中间件的函数
Except []string // 可选:不需要加密的 Cookie 名称列表
Key string // 必填:Base64 编码的唯一密钥,用于加密和解密 Cookie
Encryptor func(decryptedString, key string) (string, error) // 可选:自定义加密函数
Decryptor func(encryptedString, key string) (string, error) // 可选:自定义解密函数
}
Config 是 encryptcookie 中间件的配置结构体
Click to show internal directories.
Click to hide internal directories.