ginutils

package
v1.10.8 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cors

func Cors(params ...interface{}) gin.HandlerFunc

Cors 处理跨域请求,支持options访问

func GetChildDomain

func GetChildDomain(host string) string

GetChildDomain 获取子域名部分

func GetJWTToken

func GetJWTToken(tokenString, tokenKey string) (t *jwt.Token, e error)

func GetJWTTokenString

func GetJWTTokenString(info map[string]interface{}, key string, exp time.Duration) (string, error)

info 存储的信息 key 加密的key exp 有效期 GetJWTTokenString 获取Token字符串

func HandlerStaticFiles added in v1.3.1

func HandlerStaticFiles(files fs.FS) gin.HandlerFunc

func StringToBytes added in v1.3.1

func StringToBytes(s string) []byte

Types

type BasicAuthPair added in v1.3.1

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

type BasicAuthPairs added in v1.3.1

type BasicAuthPairs []BasicAuthPair

func ProcessAccounts added in v1.3.1

func ProcessAccounts(accounts gin.Accounts) BasicAuthPairs

func (BasicAuthPairs) SearchCredential added in v1.3.1

func (a BasicAuthPairs) SearchCredential(authValue string) (string, bool)

Jump to

Keyboard shortcuts

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