config

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrConfigNotFound = errors.New("config file not found")
	ErrInvalidConfig  = errors.New("invalid config file")
)

Functions

func ConfigPath

func ConfigPath() (string, error)

ConfigPath returns the path to the config file

func Save

func Save(cfg *Config) error

Save writes the config to the default location

Types

type Config

type Config struct {
	Workspace   Workspace    `yaml:"workspace"`
	UI          UI           `yaml:"ui"`
	Navigation  *Navigation  `yaml:"navigation,omitempty"`
	Keybindings *Keybindings `yaml:"keybindings,omitempty"`
	Polling     *Polling     `yaml:"polling,omitempty"`
}

Config represents the application configuration

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns a config with default values

func Load

func Load() (*Config, error)

Load reads the config file from the default location

func (*Config) Validate

func (c *Config) Validate() error

Validate checks if the config has required fields

type Keybinding

type Keybinding struct {
	Key    string `yaml:"key"`
	Action string `yaml:"action"`
}

Keybinding represents a single keybinding configuration

type Keybindings

type Keybindings struct {
	Global   []Keybinding `yaml:"global,omitempty"`
	Chat     []Keybinding `yaml:"chat,omitempty"`
	Message  []Keybinding `yaml:"message,omitempty"`
	Init     []Keybinding `yaml:"init,omitempty"`
	User     []Keybinding `yaml:"user,omitempty"`
	Activity []Keybinding `yaml:"activity,omitempty"`
}

Keybindings contains keybinding configurations organized by scope

type Navigation struct {
	NumberKeysGlobal bool `yaml:"number_keys_global"` // Enable number keys (1,2,3) for tab navigation globally
}

Navigation contains navigation preferences

type Polling

type Polling struct {
	Enabled                bool `yaml:"enabled"`
	CurrentChannelInterval int  `yaml:"current_channel_interval_seconds"` // Seconds
	SidebarInterval        int  `yaml:"sidebar_interval_seconds"`         // Seconds
	ActivityInterval       int  `yaml:"activity_interval_seconds"`        // Seconds
}

Polling contains polling configuration for live updates

type UI

type UI struct {
	Theme          string `yaml:"theme"`
	VimMode        bool   `yaml:"vim_mode"`
	ShowTimestamps bool   `yaml:"show_timestamps"`
}

UI contains UI preferences

type Workspace

type Workspace struct {
	UserToken string `yaml:"user_token"`
	TeamName  string `yaml:"team_name,omitempty"`
	TeamID    string `yaml:"team_id,omitempty"`
	UserID    string `yaml:"user_id,omitempty"`
}

Workspace contains Slack workspace credentials

Jump to

Keyboard shortcuts

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