Documentation
¶
Index ¶
- Variables
- func Algorithm(alg string) func(*MFADevice)
- func DefaultColor(c Color) func(*Terminal)
- func Digits(dig int) func(*MFADevice)
- func ErrorColor(c Color) func(*Terminal)
- func Output(w Writer) func(*MFADevice)
- func Prefix(pre string) func(*Terminal)
- func RefreshPeriod(per uint) func(*MFADevice)
- func Secret(secret string) func(*MFADevice)
- func SecretFromFile(file *os.File) func(*MFADevice)
- func UpdateFrequency(p time.Duration) func(*MFADevice)
- func WarningColor(c Color) func(*Terminal)
- type Color
- type MFADevice
- type Terminal
- type Writer
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func DefaultColor ¶
DefaultColor is a functional option for setting the terminal default text color
func ErrorColor ¶
ErrorColor is a functional option for setting the terminal error text color
func Output ¶
Output is a functional option to tell an MFADevice which Writer to output OTP codes to
func Prefix ¶
Prefix is a functional option for setting a prefix to help identify an OTP (if you have multiple running)
func RefreshPeriod ¶
func SecretFromFile ¶
SecretFromFile is a functional option to tell an MFADevice to read the secret from a file
func UpdateFrequency ¶
UpdateFrequency is a functional option to tell an MFADevice to read the secret from a file
func WarningColor ¶
WarningColor is a functional option for setting the terminal warning text color
Types ¶
type MFADevice ¶
type MFADevice struct { Secret []byte Writer Writer UpdateFrequency time.Duration TOTPOptions totp.ValidateOpts }
func NewMFADevice ¶
NewMFADevice creates a new MFADevice using functional options
type Terminal ¶
type Terminal struct { Pattern string Prefix string DefaultColor Color WarningColor Color ErrorColor Color }
Terminsl is a Writer for writing out OTP codes & error/warning messages
func NewTerminal ¶
NewTerminal creates a new Terminal using functional options to set the output colors