tools

package
v1.17.62 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2023 License: AGPL-3.0 Imports: 14 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 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