config

package
v0.0.0-...-a062059 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const Name = "discordo"

Variables

This section is empty.

Functions

func DefaultConfigPath

func DefaultConfigPath() string

DefaultConfigPath returns the default configuration file path.

func DefaultLogPath

func DefaultLogPath() string

DefaultLogPath returns the default log file path.

Types

type Config

type Config struct {
	// Whether the mouse is usable or not.
	Mouse bool `yaml:"mouse"`
	// The maximum number of messages to fetch and display. Its value must not be lesser than 1 and greater than 100.
	MessagesLimit uint `yaml:"messages_limit"`
	// Whether to display the timestamps of the messages beside the displayed message or not.
	Timestamps bool `yaml:"timestamps"`
	// The timezone of the timestamps. Learn more: https://pkg.go.dev/time#LoadLocation
	Timezone string `yaml:"timezone"`
	// A textual representation of the time value formatted according to the layout defined by its value. Learn more: https://pkg.go.dev/time#Layout
	TimeFormat string `yaml:"time_format"`
	// Keybindings
	Keys KeysConfig `yaml:"keys"`
	// Theme
	Theme ThemeConfig `yaml:"theme"`
}

func New

func New() *Config

func (*Config) Load

func (cfg *Config) Load(path string) error

type InputViewKeysConfig

type InputViewKeysConfig struct {
	OpenExternalEditor string `yaml:"open_external_editor"`
	PasteClipboard     string `yaml:"paste_clipboard"`
}

type KeysConfig

type KeysConfig struct {
	MessagesView MessagesViewKeysConfig `yaml:"messages_view"`
	InputView    InputViewKeysConfig    `yaml:"input_view"`
}

type MessagesViewKeysConfig

type MessagesViewKeysConfig struct {
	OpenActionsView string `yaml:"open_actions_view"`

	SelectPreviousMessage string `yaml:"select_previous_message"`
	SelectNextMessage     string `yaml:"select_next_message"`
	SelectFirstMessage    string `yaml:"select_first_message"`
	SelectLastMessage     string `yaml:"select_last_message"`
}

type ThemeConfig

type ThemeConfig struct {
	Background string `yaml:"background"`
	Border     string `yaml:"border"`
	Title      string `yaml:"title"`
}

Jump to

Keyboard shortcuts

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