Documentation ¶
Overview ¶
Package config provides some utilities and structs to access configuration loaded via Viper
Index ¶
Constants ¶
const ( TokenKey = "token" // Slack token, string DebugKey = "debug" // Debug mode, boolean MaxAgeHandledMessages = "maxAgeHandledMessages" // The maximum age of messages before they are ignored (applicable for message updates) 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
const ( MessageProcessingPartitionCount = "advanced.messageProcessingPartitionCount" // The number of partitions used to process messages concurrently. Must be a power of two. A higher number means less chance (but higher resource usage) of delays in processing of different messages MessageProcessingBufferedMessageCount = "advanced.messageProcessingBufferedMessageCount" // The channel capacity of each message processing partition. A higher number means less chance of a given partition with a lot of slow messages to handle causing a blockage of processing on other partitions )
Advanced configuration keys, only change if you really know what you're doing and have reviewed the internals
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 LayerConfigWithDefaults ¶ added in v1.39.0
LayerConfigWithDefaults takes a loaded user configuration and layers the defaults under it
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)