Documentation
¶
Index ¶
- Constants
- func CreateApplication(theme Theme, config *Config, info string) *tview.Application
- func NewMenuView(theme Theme, devMode bool) (*Menu, *MenuCallbacks)
- func WordCompleter(wordlist []string) func(string) []string
- type ButtonStyle
- func (s ButtonStyle) SetActivatedBackground(c tcell.Color) ButtonStyle
- func (s ButtonStyle) SetActivatedBold(b bool) ButtonStyle
- func (s ButtonStyle) SetActivatedForeground(c tcell.Color) ButtonStyle
- func (s ButtonStyle) SetBackground(c tcell.Color) ButtonStyle
- func (s ButtonStyle) SetBold(b bool) ButtonStyle
- func (s ButtonStyle) SetDisabledBackground(c tcell.Color) ButtonStyle
- func (s ButtonStyle) SetDisabledBold(b bool) ButtonStyle
- func (s ButtonStyle) SetDisabledForeground(c tcell.Color) ButtonStyle
- func (s ButtonStyle) SetForeground(c tcell.Color) ButtonStyle
- type Config
- type FocusItem
- type Footer
- type Header
- type Info
- func (o *Info) GetConfirmButton() *tview.Button
- func (o *Info) GetQuitButton() *tview.Button
- func (o *Info) SetBorder(b bool) *Info
- func (o *Info) SetConfirmButtonDisabled(b bool) *Info
- func (o *Info) SetConfirmButtonSelectedFunc(fn func()) *Info
- func (o *Info) SetQuitButtonDisabled(b bool) *Info
- func (o *Info) SetQuitButtonSelectedFunc(fn func()) *Info
- type InputFieldStyle
- func (s InputFieldStyle) SetAutocompleteBackground(c tcell.Color) InputFieldStyle
- func (s InputFieldStyle) SetAutocompleteMainBackground(c tcell.Color) InputFieldStyle
- func (s InputFieldStyle) SetAutocompleteMainBold(b bool) InputFieldStyle
- func (s InputFieldStyle) SetAutocompleteMainForeground(c tcell.Color) InputFieldStyle
- func (s InputFieldStyle) SetAutocompleteSelectedBackground(c tcell.Color) InputFieldStyle
- func (s InputFieldStyle) SetAutocompleteSelectedBold(b bool) InputFieldStyle
- func (s InputFieldStyle) SetAutocompleteSelectedForeground(c tcell.Color) InputFieldStyle
- func (s InputFieldStyle) SetFieldBackground(c tcell.Color) InputFieldStyle
- func (s InputFieldStyle) SetFieldBold(b bool) InputFieldStyle
- func (s InputFieldStyle) SetFieldForeground(c tcell.Color) InputFieldStyle
- func (s InputFieldStyle) SetLabelBackground(c tcell.Color) InputFieldStyle
- func (s InputFieldStyle) SetLabelBold(b bool) InputFieldStyle
- func (s InputFieldStyle) SetLabelForeground(c tcell.Color) InputFieldStyle
- func (s InputFieldStyle) SetPlaceholderBackground(c tcell.Color) InputFieldStyle
- func (s InputFieldStyle) SetPlaceholderBold(b bool) InputFieldStyle
- func (s InputFieldStyle) SetPlaceholderForeground(c tcell.Color) InputFieldStyle
- type InputFieldStyles
- type ListItemStyle
- func (s ListItemStyle) SetMainBackground(c tcell.Color) ListItemStyle
- func (s ListItemStyle) SetMainBold(b bool) ListItemStyle
- func (s ListItemStyle) SetMainForeground(c tcell.Color) ListItemStyle
- func (s ListItemStyle) SetSecondaryBackground(c tcell.Color) ListItemStyle
- func (s ListItemStyle) SetSecondaryBold(b bool) ListItemStyle
- func (s ListItemStyle) SetSecondaryForeground(c tcell.Color) ListItemStyle
- func (s ListItemStyle) SetSelectedBackground(c tcell.Color) ListItemStyle
- func (s ListItemStyle) SetSelectedBold(b bool) ListItemStyle
- func (s ListItemStyle) SetSelectedForeground(c tcell.Color) ListItemStyle
- func (s ListItemStyle) SetShortcutBackground(c tcell.Color) ListItemStyle
- func (s ListItemStyle) SetShortcutBold(b bool) ListItemStyle
- func (s ListItemStyle) SetShortcutForeground(c tcell.Color) ListItemStyle
- type ListItemStyles
- type Menu
- func (m *Menu) ClearBruteForceResults() *Menu
- func (m *Menu) GetItem(shortcut rune) (int, *responsive.ResponsiveListItem)
- func (m *Menu) MarkFailure(shortcut rune)
- func (m *Menu) MarkNeutral(shortcut rune) *Menu
- func (m *Menu) MarkSuccess(shortcut rune)
- func (m *Menu) SetBorder(b bool) *Menu
- func (m *Menu) SetClearMnemonicHandler(fn func()) *Menu
- func (m *Menu) SetCreateRandomMnemonicHandler(fn func()) *Menu
- func (m *Menu) SetDisplaySeedHandler(fn func()) *Menu
- func (m *Menu) SetEditMnemonicHandler(fn func()) *Menu
- func (m *Menu) SetExhaustedMissingWords()
- func (m *Menu) SetExhaustedSwappedWords()
- func (m *Menu) SetExhaustedWrongWord()
- func (m *Menu) SetFindMissingWordsHandler(fn func()) *Menu
- func (m *Menu) SetFindSwappedWordsHandler(fn func()) *Menu
- func (m *Menu) SetFindWrongWordHandler(fn func()) *Menu
- func (m *Menu) SetFoundMissingWords()
- func (m *Menu) SetFoundSwappedWords()
- func (m *Menu) SetFoundWrongWord()
- func (m *Menu) SetNextEnabledItem() *Menu
- func (m *Menu) SetPreviousEnabledItem() *Menu
- func (m *Menu) SetQuitHandler(fn func()) *Menu
- func (m *Menu) SetShowInfoHandler(fn func()) *Menu
- type MenuCallbacks
- type MnemonicWordInputField
- type PasswordInputField
- type QRCodeView
- type ResultView
- type SeedView
- func (v *SeedView) FocusAdjacent(current int)
- func (v *SeedView) FocusNext(current int)
- func (v *SeedView) FocusPrev(current int)
- func (v *SeedView) GetCipherSeed() (seed *aezeed.CipherSeed, err error)
- func (v *SeedView) GetMnemonic() (mnemonic aezeed.Mnemonic, err error)
- func (v *SeedView) GetPassword() string
- func (v *SeedView) GetSettings() crack.MnemonicSettings
- func (v *SeedView) GetWords() (words []string)
- func (v *SeedView) HighlightWords(xs []int) *SeedView
- func (v *SeedView) SetDoneFunc(fn func(tcell.Key)) *SeedView
- func (v *SeedView) SetItemText(idx int, text string)
- func (v *SeedView) SetMnemonicInputFocusFunc(fn func()) *SeedView
- func (v *SeedView) SetOnMnemonicChangedFunc(fn func(words []string, valid bool)) *SeedView
- func (v *SeedView) SetPasswordInputFocusFunc(fn func()) *SeedView
- func (v *SeedView) SetWords(words []string)
- type TextViewStyle
- func (s TextViewStyle) SetLabelBackground(c tcell.Color) TextViewStyle
- func (s TextViewStyle) SetLabelBold(b bool) TextViewStyle
- func (s TextViewStyle) SetLabelForeground(c tcell.Color) TextViewStyle
- func (s TextViewStyle) SetTextBackground(c tcell.Color) TextViewStyle
- func (s TextViewStyle) SetTextBold(b bool) TextViewStyle
- func (s TextViewStyle) SetTextForeground(c tcell.Color) TextViewStyle
- type TextViewStyles
- type Theme
Constants ¶
View Source
const ( Title = "aezeed-recover" InfoPageName = "infoPage" MenuPageName = "menuPage" ResultPageName = "resultPage" MnemonicInputFooterHint = "Select mnemonic" + " words or paste from clipboard (or ESC to menu)." )
View Source
const ( QuitButtonLabel = "Quit" ConsentButtonLabel = "Agree" )
View Source
const ( ShowInfoHelp = "return to info page." ShowInfoShortcut = 'i' RandomMnemonicHelp = "create a random mnemonic." RandomMnemonicShortcut = 'r' EditMnemonicHelp = "edit or paste mnemonic words." EditMnemonicShortcut = 'e' ClearMnemonicHelp = "clear mnemonic words." ClearMnemonicShortcut = 'c' FindMissingWordsHelp = "brute force missing words." FindMissingWordsShortcut = 'm' FindSwappedWordsHelp = "brute force swapped words." FindSwappedWordsShortcut = 's' FindWrongWordHelp = "find a single wrong word." FindWrongWordShortcut = 'w' DisplaySeedHelp = "display additional seed information." DisplaySeedShortcut = 'd' QuitHelp = "quit application and return to shell." QuitShortcut = 'q' )
View Source
const ( // Url = "https://recovery.mustwork.de" // TODO - implement LnUrl Url = "bc1qfkv06pjcgq280f42nu66ktdfeer7f06lmtgerp" // TODO - parse from README.md ReturnButtonLabel = "Return" Plea = `Success! Please consider a donation to keep this tool awesome.` )
View Source
const ( InvalidWords = "✗ invalid words" IncompleteMnemonic = "✗ incomplete mnemonic" InvalidMnemonic = "✗ invalid mnemonic" ValidMnemonic = "✓ valid mnemonic" PasswordInputFieldWidth = 16 )
TODO - detect, whether terminal supports character range: check mark: '\u2713' = (✓) cross mark: '\u2717' = (✗)
Variables ¶
This section is empty.
Functions ¶
func CreateApplication ¶
func CreateApplication(theme Theme, config *Config, info string) *tview.Application
func NewMenuView ¶
func NewMenuView(theme Theme, devMode bool) (*Menu, *MenuCallbacks)
func WordCompleter ¶
Types ¶
type ButtonStyle ¶
type ButtonStyle struct { Style tcell.Style Activated tcell.Style Disabled tcell.Style }
func NewButtonStyle ¶
func NewButtonStyle(theme tview.Theme) ButtonStyle
func (ButtonStyle) SetActivatedBackground ¶
func (s ButtonStyle) SetActivatedBackground(c tcell.Color) ButtonStyle
func (ButtonStyle) SetActivatedBold ¶
func (s ButtonStyle) SetActivatedBold(b bool) ButtonStyle
func (ButtonStyle) SetActivatedForeground ¶
func (s ButtonStyle) SetActivatedForeground(c tcell.Color) ButtonStyle
func (ButtonStyle) SetBackground ¶
func (s ButtonStyle) SetBackground(c tcell.Color) ButtonStyle
func (ButtonStyle) SetBold ¶
func (s ButtonStyle) SetBold(b bool) ButtonStyle
func (ButtonStyle) SetDisabledBackground ¶
func (s ButtonStyle) SetDisabledBackground(c tcell.Color) ButtonStyle
func (ButtonStyle) SetDisabledBold ¶
func (s ButtonStyle) SetDisabledBold(b bool) ButtonStyle
func (ButtonStyle) SetDisabledForeground ¶
func (s ButtonStyle) SetDisabledForeground(c tcell.Color) ButtonStyle
func (ButtonStyle) SetForeground ¶
func (s ButtonStyle) SetForeground(c tcell.Color) ButtonStyle
type Header ¶
func NewHeaderView ¶
func NewHeaderView() *Header
type Info ¶
func NewInfoView ¶
func (*Info) GetConfirmButton ¶
func (*Info) GetQuitButton ¶
func (*Info) SetConfirmButtonDisabled ¶
func (*Info) SetConfirmButtonSelectedFunc ¶
func (*Info) SetQuitButtonDisabled ¶
func (*Info) SetQuitButtonSelectedFunc ¶
type InputFieldStyle ¶
type InputFieldStyle struct { Label tcell.Style Field tcell.Style Placeholder tcell.Style AutocompleteMain tcell.Style AutocompleteSelected tcell.Style AutocompleteBackground tcell.Color }
func NewInputFieldStyle ¶
func NewInputFieldStyle(theme tview.Theme) InputFieldStyle
func (InputFieldStyle) SetAutocompleteBackground ¶
func (s InputFieldStyle) SetAutocompleteBackground(c tcell.Color) InputFieldStyle
func (InputFieldStyle) SetAutocompleteMainBackground ¶
func (s InputFieldStyle) SetAutocompleteMainBackground(c tcell.Color) InputFieldStyle
func (InputFieldStyle) SetAutocompleteMainBold ¶
func (s InputFieldStyle) SetAutocompleteMainBold(b bool) InputFieldStyle
func (InputFieldStyle) SetAutocompleteMainForeground ¶
func (s InputFieldStyle) SetAutocompleteMainForeground(c tcell.Color) InputFieldStyle
func (InputFieldStyle) SetAutocompleteSelectedBackground ¶
func (s InputFieldStyle) SetAutocompleteSelectedBackground(c tcell.Color) InputFieldStyle
func (InputFieldStyle) SetAutocompleteSelectedBold ¶
func (s InputFieldStyle) SetAutocompleteSelectedBold(b bool) InputFieldStyle
func (InputFieldStyle) SetAutocompleteSelectedForeground ¶
func (s InputFieldStyle) SetAutocompleteSelectedForeground(c tcell.Color) InputFieldStyle
func (InputFieldStyle) SetFieldBackground ¶
func (s InputFieldStyle) SetFieldBackground(c tcell.Color) InputFieldStyle
func (InputFieldStyle) SetFieldBold ¶
func (s InputFieldStyle) SetFieldBold(b bool) InputFieldStyle
func (InputFieldStyle) SetFieldForeground ¶
func (s InputFieldStyle) SetFieldForeground(c tcell.Color) InputFieldStyle
func (InputFieldStyle) SetLabelBackground ¶
func (s InputFieldStyle) SetLabelBackground(c tcell.Color) InputFieldStyle
func (InputFieldStyle) SetLabelBold ¶
func (s InputFieldStyle) SetLabelBold(b bool) InputFieldStyle
func (InputFieldStyle) SetLabelForeground ¶
func (s InputFieldStyle) SetLabelForeground(c tcell.Color) InputFieldStyle
func (InputFieldStyle) SetPlaceholderBackground ¶
func (s InputFieldStyle) SetPlaceholderBackground(c tcell.Color) InputFieldStyle
func (InputFieldStyle) SetPlaceholderBold ¶
func (s InputFieldStyle) SetPlaceholderBold(b bool) InputFieldStyle
func (InputFieldStyle) SetPlaceholderForeground ¶
func (s InputFieldStyle) SetPlaceholderForeground(c tcell.Color) InputFieldStyle
type InputFieldStyles ¶
type InputFieldStyles struct { Valid InputFieldStyle Invalid InputFieldStyle Highlight InputFieldStyle }
type ListItemStyle ¶
type ListItemStyle struct { Main tcell.Style Secondary tcell.Style Shortcut tcell.Style Selected tcell.Style }
func NewListItemStyle ¶
func NewListItemStyle(theme tview.Theme) ListItemStyle
func (ListItemStyle) SetMainBackground ¶
func (s ListItemStyle) SetMainBackground(c tcell.Color) ListItemStyle
func (ListItemStyle) SetMainBold ¶
func (s ListItemStyle) SetMainBold(b bool) ListItemStyle
func (ListItemStyle) SetMainForeground ¶
func (s ListItemStyle) SetMainForeground(c tcell.Color) ListItemStyle
func (ListItemStyle) SetSecondaryBackground ¶
func (s ListItemStyle) SetSecondaryBackground(c tcell.Color) ListItemStyle
func (ListItemStyle) SetSecondaryBold ¶
func (s ListItemStyle) SetSecondaryBold(b bool) ListItemStyle
func (ListItemStyle) SetSecondaryForeground ¶
func (s ListItemStyle) SetSecondaryForeground(c tcell.Color) ListItemStyle
func (ListItemStyle) SetSelectedBackground ¶
func (s ListItemStyle) SetSelectedBackground(c tcell.Color) ListItemStyle
func (ListItemStyle) SetSelectedBold ¶
func (s ListItemStyle) SetSelectedBold(b bool) ListItemStyle
func (ListItemStyle) SetSelectedForeground ¶
func (s ListItemStyle) SetSelectedForeground(c tcell.Color) ListItemStyle
func (ListItemStyle) SetShortcutBackground ¶
func (s ListItemStyle) SetShortcutBackground(c tcell.Color) ListItemStyle
func (ListItemStyle) SetShortcutBold ¶
func (s ListItemStyle) SetShortcutBold(b bool) ListItemStyle
func (ListItemStyle) SetShortcutForeground ¶
func (s ListItemStyle) SetShortcutForeground(c tcell.Color) ListItemStyle
type ListItemStyles ¶
type ListItemStyles struct { Enabled ListItemStyle Disabled ListItemStyle }
type Menu ¶
type Menu struct { *responsive.ResponsiveList // contains filtered or unexported fields }
func (*Menu) ClearBruteForceResults ¶
func (*Menu) GetItem ¶
func (m *Menu) GetItem(shortcut rune) (int, *responsive.ResponsiveListItem)
func (*Menu) MarkFailure ¶
func (*Menu) MarkNeutral ¶
func (*Menu) MarkSuccess ¶
func (*Menu) SetClearMnemonicHandler ¶
func (*Menu) SetCreateRandomMnemonicHandler ¶
func (*Menu) SetDisplaySeedHandler ¶
func (*Menu) SetEditMnemonicHandler ¶
func (*Menu) SetExhaustedMissingWords ¶
func (m *Menu) SetExhaustedMissingWords()
func (*Menu) SetExhaustedSwappedWords ¶
func (m *Menu) SetExhaustedSwappedWords()
func (*Menu) SetExhaustedWrongWord ¶
func (m *Menu) SetExhaustedWrongWord()
func (*Menu) SetFindMissingWordsHandler ¶
func (*Menu) SetFindSwappedWordsHandler ¶
func (*Menu) SetFindWrongWordHandler ¶
func (*Menu) SetFoundMissingWords ¶
func (m *Menu) SetFoundMissingWords()
func (*Menu) SetFoundSwappedWords ¶
func (m *Menu) SetFoundSwappedWords()
func (*Menu) SetFoundWrongWord ¶
func (m *Menu) SetFoundWrongWord()
func (*Menu) SetNextEnabledItem ¶
func (*Menu) SetPreviousEnabledItem ¶
func (*Menu) SetQuitHandler ¶
func (*Menu) SetShowInfoHandler ¶
type MenuCallbacks ¶
type MenuCallbacks struct { OnMnemonicValid func() OnMnemonicInvalid func() OnMnemonicPartial func() OnMnemonicInsufficient func() }
type MnemonicWordInputField ¶
type MnemonicWordInputField struct { *tview.InputField Theme Theme // contains filtered or unexported fields }
func NewMnemonicInputField ¶
func NewMnemonicInputField(seedView *SeedView, i int, wordCompleter func(string) []string) *MnemonicWordInputField
func (*MnemonicWordInputField) Highlight ¶
func (i *MnemonicWordInputField) Highlight() *MnemonicWordInputField
func (MnemonicWordInputField) IsEmpty ¶
func (f MnemonicWordInputField) IsEmpty() bool
func (*MnemonicWordInputField) SetText ¶
func (i *MnemonicWordInputField) SetText(text string) *MnemonicWordInputField
type PasswordInputField ¶
type PasswordInputField struct {
*tview.InputField
}
func NewPasswordInputField ¶
func NewPasswordInputField(theme Theme, config *Config, seedView *SeedView) *PasswordInputField
func (*PasswordInputField) SetFieldTextColor ¶
func (p *PasswordInputField) SetFieldTextColor(color tcell.Color) *PasswordInputField
type QRCodeView ¶
func NewQRCodeView ¶
func NewQRCodeView() *QRCodeView
type ResultView ¶
func NewResultView ¶
func NewResultView(setFocus func(tview.Primitive) *tview.Application) *ResultView
func (*ResultView) SetBorder ¶
func (v *ResultView) SetBorder(b bool) *ResultView
func (*ResultView) SetQuitButtonSelectedFunc ¶
func (v *ResultView) SetQuitButtonSelectedFunc(f func()) *ResultView
func (*ResultView) SetReturnButtonSelectedFunc ¶
func (v *ResultView) SetReturnButtonSelectedFunc(f func()) *ResultView
type SeedView ¶
func NewSeedView ¶
func (*SeedView) FocusAdjacent ¶
func (*SeedView) GetCipherSeed ¶
func (v *SeedView) GetCipherSeed() (seed *aezeed.CipherSeed, err error)
func (*SeedView) GetMnemonic ¶
func (*SeedView) GetPassword ¶
func (*SeedView) GetSettings ¶
func (v *SeedView) GetSettings() crack.MnemonicSettings
func (*SeedView) HighlightWords ¶
func (*SeedView) SetDoneFunc ¶
func (*SeedView) SetItemText ¶
func (*SeedView) SetMnemonicInputFocusFunc ¶
func (*SeedView) SetOnMnemonicChangedFunc ¶
func (*SeedView) SetPasswordInputFocusFunc ¶
type TextViewStyle ¶
type TextViewStyle struct { Label tcell.Style Text tcell.Style }
func NewTextViewStyle ¶
func NewTextViewStyle(theme tview.Theme) TextViewStyle
func (TextViewStyle) SetLabelBackground ¶
func (s TextViewStyle) SetLabelBackground(c tcell.Color) TextViewStyle
func (TextViewStyle) SetLabelBold ¶
func (s TextViewStyle) SetLabelBold(b bool) TextViewStyle
func (TextViewStyle) SetLabelForeground ¶
func (s TextViewStyle) SetLabelForeground(c tcell.Color) TextViewStyle
func (TextViewStyle) SetTextBackground ¶
func (s TextViewStyle) SetTextBackground(c tcell.Color) TextViewStyle
func (TextViewStyle) SetTextBold ¶
func (s TextViewStyle) SetTextBold(b bool) TextViewStyle
func (TextViewStyle) SetTextForeground ¶
func (s TextViewStyle) SetTextForeground(c tcell.Color) TextViewStyle
type TextViewStyles ¶
type TextViewStyles struct { Valid TextViewStyle Invalid TextViewStyle }
type Theme ¶
type Theme struct { tview.Theme Button ButtonStyle ListItem ListItemStyles InputField InputFieldStyles TextView TextViewStyles }
func UniversalTheme ¶
func UniversalTheme() Theme
UniversalTheme returns a theme that works well with both light and dark terminal settings.
Click to show internal directories.
Click to hide internal directories.