save

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2023 License: MIT Imports: 11 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{}

func NewAccountProvider

func NewAccountProvider() 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 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