save

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func CreateDBFile added in v0.4.0

func CreateDBFile() (string, error)

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 ChatSettings added in v0.4.0

type ChatSettings struct {
	GraphicEmotes bool `yaml:"graphic_emotes"`
}

type KeyMap added in v0.0.2

type KeyMap struct {
	// General
	Up      key.Binding `yaml:"up"`
	Down    key.Binding `yaml:"down"`
	Escape  key.Binding `yaml:"escape"`
	Confirm key.Binding `yaml:"confirm"`
	Help    key.Binding `yaml:"help"`

	// App Binds
	Quit       key.Binding `yaml:"quit"`
	Create     key.Binding `yaml:"create"`
	Remove     key.Binding `yaml:"remove"`
	CloseTab   key.Binding `yaml:"close_tab"`
	DumpScreen key.Binding `yaml:"dump_screen"` // used by lists, and join input type switch

	// Tab Binds
	Next     key.Binding `yaml:"next"`
	Previous key.Binding `yaml:"previous"`

	// Chat Binds
	InsertMode   key.Binding `yaml:"insert_mode"`
	InspectMode  key.Binding `yaml:"inspect_mode"`
	ChatPopUp    key.Binding `yaml:"chat_pop_up"`
	ChannelPopUp key.Binding `yaml:"channel_pop_up"`
	GoToTop      key.Binding `yaml:"go_to_top"`
	GoToBottom   key.Binding `yaml:"go_to_bottom"`
	DumpChat     key.Binding `yaml:"dump_chat"`
	QuickTimeout key.Binding `yaml:"quick_timeout"`
	CopyMessage  key.Binding `yaml:"copy_message"`

	// Unban Request
	UnbanRequestMode key.Binding `yaml:"unban_request_mode"`
	PrevPage         key.Binding `yaml:"prev_page"`
	NextPage         key.Binding `yaml:"next_page"`
	PrevFilter       key.Binding `yaml:"prev_filter"`
	NextFilter       key.Binding `yaml:"next_filter"`
	Deny             key.Binding `yaml:"deny"`
	Approve          key.Binding `yaml:"approve"`

	// Account Binds
	MarkLeader key.Binding `yaml:"mark_leader"`
}

func BuildDefaultKeyMap added in v0.0.4

func BuildDefaultKeyMap() KeyMap

func CreateReadKeyMap added in v0.0.2

func CreateReadKeyMap() (KeyMap, error)

func (*KeyMap) MarshalYAML added in v0.3.0

func (c *KeyMap) MarshalYAML() (interface{}, error)

func (*KeyMap) UnmarshalYAML added in v0.3.0

func (c *KeyMap) UnmarshalYAML(value *yaml.Node) 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 ModerationSettings added in v0.4.0

type ModerationSettings struct {
	StoreChatLogs      bool     `yaml:"store_chat_logs"`
	LogsChannelInclude []string `yaml:"logs_channel_include"`
	LogsChannelExclude []string `yaml:"logs_channel_exclude"`
}

type Settings added in v0.4.0

type Settings struct {
	Moderation ModerationSettings `yaml:"moderation"`
	Chat       ChatSettings       `yaml:"chat"`
}

func BuildDefaultSettings added in v0.4.0

func BuildDefaultSettings() Settings

func SettingsFromDisk added in v0.4.0

func SettingsFromDisk() (Settings, error)

type TabState

type TabState struct {
	Channel    string `json:"channel"`
	IsFocused  bool   `json:"is_focused"`
	IdentityID string `json:"identity_id"`
	Kind       int    `json:"kind"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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