account

package
v0.0.0-...-70df2c5 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2025 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodeTextKey

func EncodeTextKey(key RawKey) string

Types

type Account

type Account struct {
	Name     string `csv:"name"`
	AcctId   string `csv:"acc_id"`
	Interval *uint  `csv:"interv"`
	Key      RawKey `csv:"key"`
}

All fields must be public because of the marshaller

func NewFromTextKey

func NewFromTextKey(text_key string) (*Account, error)

func (Account) GenKey

func (a Account) GenKey(nth uint64) (uint32, error)

Generates an RFC 6238 compliant TOTP

func (Account) GetInterval

func (a Account) GetInterval() uint

Interval default checking thunk. Account.Interval must still be public though, as the marshaller requires all fields be public

type RawKey

type RawKey []byte

go treats a simple typedef as a different type: e.g. `type MyInt int` creates my own int, but it is not interchangeable with the real int and must be explicitly casted. additionally, i can actually implement methods for, and embed my phony int into other stucts

func DecodeTextKey

func DecodeTextKey(text_key string) (RawKey, error)

func (*RawKey) MarshalCSV

func (r *RawKey) MarshalCSV() (string, error)

Implement gocsv's CSVMarshaler

func (*RawKey) UnmarshalCSV

func (r *RawKey) UnmarshalCSV(value string) (err error)

Implement gocsv's CSVUnmarshaler

Jump to

Keyboard shortcuts

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