config

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthFile

func AuthFile() string

AuthFile returns the path to the auth config file.

func ConfigDir

func ConfigDir() string

ConfigDir returns the path to the config directory (~/.config/slack).

func ConfigFile

func ConfigFile() string

ConfigFile returns the path to the main config file.

Types

type AuthConfig

type AuthConfig struct {
	BotToken    string `yaml:"bot_token,omitempty"`
	UserToken   string `yaml:"user_token,omitempty"`
	ConfigToken string `yaml:"config_token,omitempty"` // App configuration token for manifest API
	AppID       string `yaml:"app_id,omitempty"`       // Slack app ID, set after `app create`
	TeamID      string `yaml:"team_id,omitempty"`
	TeamName    string `yaml:"team_name,omitempty"`
	UserID      string `yaml:"user_id,omitempty"`       // Human user ID (from user token)
	UserName    string `yaml:"user_name,omitempty"`     // Human username (from user token)
	BotUserID   string `yaml:"bot_user_id,omitempty"`   // Bot user ID (from bot token)
	BotUserName string `yaml:"bot_user_name,omitempty"` // Bot username (from bot token)
}

AuthConfig stores authentication state on disk as a fallback when the OS keyring is unavailable.

func LoadAuth

func LoadAuth() (*AuthConfig, error)

LoadAuth reads the auth config from disk.

func (*AuthConfig) Clear

func (a *AuthConfig) Clear() error

Clear removes the stored auth config.

func (*AuthConfig) Save

func (a *AuthConfig) Save() error

Save writes the auth config to disk.

type Config

type Config struct {
	DefaultWorkspace string `yaml:"default_workspace,omitempty"`
	DefaultChannel   string `yaml:"default_channel,omitempty"`
}

Config represents the user's CLI configuration.

func Load

func Load() (*Config, error)

Load reads the config from disk, returning defaults if the file doesn't exist.

func (*Config) Save

func (c *Config) Save() error

Save writes the config to disk.

Jump to

Keyboard shortcuts

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