storage

package
v0.0.0-...-ec244d1 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteCode

func DeleteCode(id string)

func InsertCode

func InsertCode(secretOrUri string)

func Pad

func Pad(buf []byte, size int) []byte

func SaveCode

func SaveCode(codes Codes)

func SaveConfigure

func SaveConfigure(conf Configure)

func SyncCode

func SyncCode(cs []Code)

func Unpad

func Unpad(buf []byte) ([]byte, error)

func UpdateCodeName

func UpdateCodeName(id string, name string)

Types

type Code

type Code struct {
	ID        string       `json:"id"`
	Type      string       `json:"type"`
	Name      string       `json:"name"`
	Algorithm string       `json:"algorithm"`
	Digits    string       `json:"digits"`
	Issuer    string       `json:"issuer"`
	Period    string       `json:"period"`
	Secret    *EncryptData `json:"secret"`
}

func ParseCode

func ParseCode(rawUri string) (*Code, error)

func (*Code) Encode

func (c *Code) Encode() string

type Codes

type Codes []Code

func LoadCodes

func LoadCodes() Codes

type Configure

type Configure struct {
	ExitWhenWindowClose bool `json:"exitWhenWindowClose"`
	ShowTray            bool `json:"showTray"`
	WindowMode          bool `json:"windowMode"`
}

func LoadConfigure

func LoadConfigure() Configure

type EncryptData

type EncryptData string

func NewEncryptData

func NewEncryptData(val string) *EncryptData

func (*EncryptData) MarshalText

func (e *EncryptData) MarshalText() (text []byte, err error)

func (*EncryptData) UnmarshalText

func (e *EncryptData) UnmarshalText(text []byte) error

func (*EncryptData) Val

func (e *EncryptData) Val() string

Jump to

Keyboard shortcuts

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