Documentation ¶
Index ¶
- Constants
- Variables
- func ChannelAdd(username string)
- func ChannelDelete(username string)
- func ChannelDisable(username string)
- func ChannelEnable(username string)
- func ChannelUpdateID(username string, id int64)
- type Channels
- type Config
- func (c *Config) AutomaticEnv(ctxLog *log.Entry)
- func (c *Config) ChannelList() (string, string)
- func (c *Config) ConfigFileExists(filepath string) bool
- func (c *Config) CreateDefaultConf() error
- func (c *Config) GetRecAmountChannels() int
- func (c *Config) IsChannelInConfig(channel string) bool
- func (c *Config) Load() error
- func (c *Config) MakeDefaultConfStruct()
- func (c *Config) Save() error
- func (c *Config) SetConfFile(ctxLog *log.Entry)
- func (c *Config) SetLogLevel(ctxLog *log.Entry)
- func (c *Config) SetStreamsDir(ctxLog *log.Entry)
Constants ¶
View Source
const ConfigFile = "rekoda.toml"
Variables ¶
View Source
var ( EnvConfigFile = os.Getenv("REKODA_CONF_FILE") EnvConfigDir = os.Getenv("REKODA_CONF_DIR") EnvStreamsDir = os.Getenv("REKODA_STREAMS_DIR") FlagConfigFile = "" FlagConfigDir = "" FlagStreamsDir = "" EnvLogLevel = os.Getenv("REKODA_LOG_LEVEL") // Options: trace, debug, info (default) FlagLogLevel = "" )
Functions ¶
func ChannelAdd ¶
func ChannelAdd(username string)
func ChannelDelete ¶
func ChannelDelete(username string)
func ChannelDisable ¶
func ChannelDisable(username string)
func ChannelEnable ¶
func ChannelEnable(username string)
func ChannelUpdateID ¶
Types ¶
type Config ¶
type Config struct { Title string `toml:"title"` Version int `toml:"version"` ConfigDir string `toml:"config_dir"` ConfigFile string `toml:"config_file"` StreamsDir string `toml:"streams_dir"` Channels []Channels `toml:"channels"` }
var ConfigStruct Config
func InitConfig ¶
func InitConfig() *Config
initConfig reads in config file and ENV variables if set, otherwise initialize default conf
func (*Config) AutomaticEnv ¶
func (*Config) ChannelList ¶
ChannelList lists all channels in Config struct
func (*Config) ConfigFileExists ¶
ConfigFileExists checks if config file exists in the stated filepath parameter
func (*Config) CreateDefaultConf ¶
CreateDefaultConf creates default rekoda.toml conf file and writes it to disk. Used by default when --config or REKODA_CONF_FILE environement is not specified by user and rekoda.toml file does not exists in its default path ($HOME/rekoda/rekoda.toml)
func (*Config) GetRecAmountChannels ¶
GetRecAmountChannels returns amount of channels being enabled for record
func (*Config) IsChannelInConfig ¶
IsChannelInConfig checks if specific channel is in Config struct
func (*Config) MakeDefaultConfStruct ¶
func (c *Config) MakeDefaultConfStruct()
MakeDefaultConfStruct initializes default conf struct
func (*Config) SetConfFile ¶
func (*Config) SetLogLevel ¶
func (*Config) SetStreamsDir ¶
Click to show internal directories.
Click to hide internal directories.