helper

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const ExportQRCodeSize = 256

ExportQRCodeSize the size of QR code to export

View Source
const PrintQRCodeAllSize = 49

PrintQRCodeAllSize the size of QR code to print

View Source
const PrintQRCodeSize = 35

PrintQRCodeAllSize the size of QR code to print

Variables

This section is empty.

Functions

func GetDatafilePath

func GetDatafilePath() string

GetDatafilePath Get path of data file

func NewData

func NewData() *entity.Data

NewData Get new data

func PrintQRCode

func PrintQRCode(file string) error

PrintQRCode print the QR code to terminal

func ReadData

func ReadData() (*entity.Data, error)

ReadData read data from file

func WriteData

func WriteData(data *entity.Data) error

WriteData write data to file

Types

type GoogleAuthenticator

type GoogleAuthenticator struct{}

GoogleAuthenticator Google Authenticator

func NewGoogleAuthenticator

func NewGoogleAuthenticator() *GoogleAuthenticator

NewGoogleAuthenticator new Google Authenticator

func (*GoogleAuthenticator) GenerateSecret

func (ga *GoogleAuthenticator) GenerateSecret() (string, error)

GenerateSecret generate new secret

func (*GoogleAuthenticator) GetCode

func (ga *GoogleAuthenticator) GetCode(secret string) (code string, err error)

GetCode get code by secret

func (*GoogleAuthenticator) GetQRCode

func (ga *GoogleAuthenticator) GetQRCode(user, secret string) string

GetQRCode get QR code content

Jump to

Keyboard shortcuts

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