Documentation ¶
Overview ¶
Package config provides some utilities and structs to access configuration loaded via Viper
Index ¶
Constants ¶
View Source
const ( TokenKey = "token" // Slack token, string DebugKey = "debug" // Debug mode, boolean ResponseCacheSizeKey = "responseCacheSize" // Response cache size in number of entries, int TimeLocationKey = "timeLocation" // Time Location as understood by time.LoadLocation ThreadedRepliesKey = "replyBehavior.threadedReplies" // Threaded replies mode (slackscot will respond to all triggering messages using threads), boolean BroadcastThreadedRepliesKey = "replyBehavior.broadcastThreadedReplies" // Broadcast threaded replies (slackscot will set broadcast on threaded replies, only applies if threaded replies are enabled), boolean PluginsKey = "plugins" // Root element of the map of string key/values for plugins string UserInfoCacheSizeKey = "userInfoCacheSize" // The number of entries to keep in the user info cache, int value. Defaults to no caching (value of 0) )
Slackscot global configuration keys
Variables ¶
This section is empty.
Functions ¶
func GetTimeLocation ¶
GetTimeLocation reads the TimeLocation configuration and maps it to the appropriate time.Location value. Returns an err if the location value is invalid
func NewViperWithDefaults ¶
NewViperWithDefaults creates a new viper instance with defaults set on it
Types ¶
type PluginConfig ¶
PluginConfig is a sub-viper instance holding the subtree specific to a named plugin
func GetPluginConfig ¶
func GetPluginConfig(v *viper.Viper, name string) (pluginConfig *PluginConfig, err error)
GetPluginConfig returns the viper sub-tree for a named plugin
type ReplyBehavior ¶
ReplyBehavior holds flags to define the replying behavior (use threads or not and broadcast replies or not)
Click to show internal directories.
Click to hide internal directories.