xgoogauth

package
v0.3.8 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: BSD-3-Clause-Clear Imports: 8 Imported by: 0

Documentation

Overview

谷歌密钥生成操作

Index

Constants

This section is empty.

Variables

View Source
var CodeTime int64 = 30

MFA密钥验证时间,默认为30 单位:秒

Functions

func Get

func Get(secret string) string

根据秘钥获取随机数字验证码

secret	秘钥标识

func GetLv added in v0.3.0

func GetLv(secret string, lv int) string

根据秘钥获取随机数字验证码

secret	秘钥标识
lv		获取层级 0-当前密钥 -1-前x秒密钥 -2-前2x秒的密钥 1-后x秒的密钥...

func Qrstring

func Qrstring(user, secret string) string

获取生成二维码的规范化字符串

user	标题
secret	秘钥

返回格式:otpauth://totp/<user>?secret=<secret>

func Regedit

func Regedit(c *Config)

注册配置项

func Secret

func Secret() string

生成秘钥

func Verify

func Verify(secret, code string) bool

验证输入的验证码是否正确

secret	秘钥
code	用户输入的验证码

Types

type Config

type Config struct {
	LogErrorFunc func(msg string, err error) // 日志导出函数
}

Jump to

Keyboard shortcuts

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