save

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAccountNotFound = errors.New("account not found")

Functions

This section is empty.

Types

type Account

type Account struct {
	ID           string    `json:"id"`
	IsMain       bool      `json:"is_main"`
	IsAnonymous  bool      `json:"-"`
	DisplayName  string    `json:"display_name"`
	AccessToken  string    `json:"access_token"`
	RefreshToken string    `json:"refresh_token"`
	CreatedAt    time.Time `json:"created_at"`
}

type AccountProvider

type AccountProvider struct {
	// contains filtered or unexported fields
}

func NewAccountProvider

func NewAccountProvider(keychain keyring.Keyring) AccountProvider

func (AccountProvider) Add

func (a AccountProvider) Add(account Account) error

func (AccountProvider) GetAccountBy

func (a AccountProvider) GetAccountBy(id string) (Account, error)

func (AccountProvider) GetAllAccounts

func (a AccountProvider) GetAllAccounts() ([]Account, error)

func (AccountProvider) GetMainAccount

func (a AccountProvider) GetMainAccount() (Account, error)

func (AccountProvider) MarkAccountAsMain

func (a AccountProvider) MarkAccountAsMain(id string) error

func (AccountProvider) Remove

func (a AccountProvider) Remove(id string) error

func (AccountProvider) UpdateTokensFor

func (a AccountProvider) UpdateTokensFor(id, accessToken, refreshToken string) error

type AppState

type AppState struct {
	Tabs []TabState `json:"tabs"`
}

func AppStateFromDisk

func AppStateFromDisk() (AppState, error)

func (*AppState) Save

func (a *AppState) Save() error

type KeyMap added in v0.0.2

type KeyMap struct {
	// General
	Up      key.Binding
	Down    key.Binding
	Escape  key.Binding
	Confirm key.Binding
	Help    key.Binding

	// App Binds
	Quit       key.Binding
	Create     key.Binding
	Remove     key.Binding
	CloseTab   key.Binding
	DumpScreen key.Binding

	// Tab Binds
	Next     key.Binding
	Previous key.Binding

	// Chat Binds
	InsertMode   key.Binding
	InspectMode  key.Binding
	ChatPopUp    key.Binding
	GoToTop      key.Binding
	GoToBottom   key.Binding
	DumpChat     key.Binding
	QuickTimeout key.Binding
	CopyMessage  key.Binding

	// Unban Request
	PrevPage   key.Binding
	NextPage   key.Binding
	PrevFilter key.Binding
	NextFilter key.Binding
	Deny       key.Binding
	Approve    key.Binding

	// Account Binds
	MarkLeader key.Binding
}

func BuildDefaultKeyMap added in v0.0.4

func BuildDefaultKeyMap() KeyMap

func CreateReadKeyMap added in v0.0.2

func CreateReadKeyMap() (KeyMap, error)

type KeyringWrapper added in v0.0.10

type KeyringWrapper struct{}

func (KeyringWrapper) Delete added in v0.0.10

func (k KeyringWrapper) Delete(service, user string) error

func (KeyringWrapper) Get added in v0.0.10

func (k KeyringWrapper) Get(service, user string) (string, error)

func (KeyringWrapper) Set added in v0.0.10

func (k KeyringWrapper) Set(service, user, password string) error

type TabState

type TabState struct {
	Channel       string                    `json:"channel"`
	IsFocused     bool                      `json:"is_focused"`
	IdentityID    string                    `json:"identity_id"`
	SelectedIndex int                       `json:"selected_index"`
	IRCMessages   []*command.PrivateMessage `json:"irc_messages"`
}

Jump to

Keyboard shortcuts

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