Documentation ¶
Index ¶
- Constants
- type AlfredOutput
- type Device
- func (d *Device) ConfigPath(fname string) (string, error)
- func (d *Device) DeleteMainPassword()
- func (d *Device) LoadExistingDeviceInfo() (devInfo DeviceRegistration, err error)
- func (d *Device) LoadTokenFromAuthyServer()
- func (d *Device) LoadTokenFromCache() (err error)
- func (d *Device) RegisterOrGetDeviceInfo() (devInfo DeviceRegistration)
- func (d *Device) SaveDeviceInfo() (err error)
- type DeviceRegistration
- type NewDeviceConfig
- type Output
- type Searcher
- type Token
- type Tokens
Constants ¶
View Source
const ( // Red red Red = "\033[1;31m%s\033[0m" // Green green Green = "\033[1;32m%s\033[0m" // Teal teal Teal = "\033[1;36m%s\033[0m" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlfredOutput ¶
type AlfredOutput struct { Title string `json:"title"` Subtitle string `json:"subtitle"` Arg string `json:"arg"` Icon struct { Type string `json:"type"` Path string `json:"path"` } `json:"icon"` Valid bool `json:"valid"` Text struct { Copy string `json:"copy"` } `json:"text"` }
AlfredOutput ..
type Device ¶
type Device struct {
// contains filtered or unexported fields
}
Device ..
func (*Device) ConfigPath ¶
ConfigPath get config file path Return the path to the config file If the file does not exist, it will be created at $HOME ( or optionally AUTHY_ROOT )
func (*Device) DeleteMainPassword ¶
func (d *Device) DeleteMainPassword()
DeleteMainPassword delete main password
func (*Device) LoadExistingDeviceInfo ¶
func (d *Device) LoadExistingDeviceInfo() (devInfo DeviceRegistration, err error)
LoadExistingDeviceInfo ...
func (*Device) LoadTokenFromAuthyServer ¶
func (d *Device) LoadTokenFromAuthyServer()
LoadTokenFromAuthyServer load token from authy server, make sure that you've enabled Authenticator Backups And Multi-Device Sync
func (*Device) LoadTokenFromCache ¶
LoadTokenFromCache load token from local cache
func (*Device) RegisterOrGetDeviceInfo ¶
func (d *Device) RegisterOrGetDeviceInfo() (devInfo DeviceRegistration)
RegisterOrGetDeviceInfo get device info from local cache, if not exist register a new device
type DeviceRegistration ¶
type DeviceRegistration struct { UserID uint64 `json:"user_id,omitempty"` DeviceID uint64 `json:"device_id,omitempty"` Seed string `json:"seed,omitempty"` APIKey string `json:"api_key,omitempty"` MainPassword string `json:"main_password,omitempty"` }
DeviceRegistration device register info
type NewDeviceConfig ¶
type NewDeviceConfig struct { CountryCode string Mobile string Password string ConfigFilePath string ConfigFileName string CacheFileName string }
NewDeviceConfig new device config
Click to show internal directories.
Click to hide internal directories.