tools

package
v1.19.30 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2024 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Http *tool.Http

Functions

func GenCallback

func GenCallback(callback, token string) (string, error)

func GetAccessClaims added in v1.17.2

func GetAccessClaims(c *gin.Context) *jwtClaims.AccessToken

func GetAppCode added in v1.17.2

func GetAppCode(c *gin.Context) string

func GetUserInfo

func GetUserInfo(c *gin.Context) *jwtClaims.UserToken

func IsIntranet added in v1.17.65

func IsIntranet(ip string) bool

IsIntranet 是否是同一局域网

func MustTcpListen added in v1.17.19

func MustTcpListen(addr string) net.Listener

func NewMfa

func NewMfa(uid uint) (*otp.Key, error)

func RunGrpcSrv added in v1.17.19

func RunGrpcSrv(tcpListen net.Listener, srv *grpc.Server)

func RunHttpSrv added in v1.17.19

func RunHttpSrv(srv *http.Server)

func ShouldBindReused added in v1.17.4

func ShouldBindReused(c *gin.Context, obj any) error

func VerifyMfa

func VerifyMfa(code, secret string) (bool, error)

Types

type UintSlice

type UintSlice []uint

func (UintSlice) Len

func (a UintSlice) Len() int

func (UintSlice) Less

func (a UintSlice) Less(i, j int) bool

func (UintSlice) Swap

func (a UintSlice) Swap(i, j int)

Jump to

Keyboard shortcuts

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