config

package
v0.0.0-...-a11563c Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConfigDirPath = filepath.Join(usr.HomeDir, ".slack-status-cli")
View Source
var ConfigFilePath = filepath.Join(ConfigDirPath, "config")

Functions

This section is empty.

Types

type Config

type Config struct {
	Default  ProfileInfo
	Globals  []StatusStore
	Profiles map[string]Profile
}

func (*Config) AddGlobalStatus

func (c *Config) AddGlobalStatus(store StatusStore)

func (*Config) AddProfile

func (c *Config) AddProfile(profileInfo ProfileInfo)

func (*Config) AddStatus

func (c *Config) AddStatus(store StatusStore)

AddStatus adds status to the default profile

func (*Config) DeleteProfile

func (c *Config) DeleteProfile(profile string)

func (*Config) EditStatus

func (c *Config) EditStatus(profile string, statusList []string)

func (*Config) GetProfileStatus

func (c *Config) GetProfileStatus() ([]string, error)

func (*Config) GetProfiles

func (c *Config) GetProfiles() []string

func (*Config) Load

func (c *Config) Load()

Load config file values

func (*Config) RenameProfile

func (c *Config) RenameProfile(profile string)

func (*Config) Save

func (c *Config) Save()

func (*Config) UpdateToken

func (c *Config) UpdateToken(profile string)

type Profile

type Profile struct {
	Token      string `mapstructure:"token"`
	StatusList map[string]StatusStore
}

type ProfileInfo

type ProfileInfo struct {
	Name  string `mapstructure:"name"`
	Token string `mapstructure:"token"`
}

type StatusStore

type StatusStore struct {
	Status              string
	UserDefinedDuration string
	Period              int
	Emoji               string
}

Mapping key: emoji status UserDefinedDuration

Jump to

Keyboard shortcuts

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