Documentation ¶
Index ¶
- func GetPlugins(request slack.Request, config config.Config) map[string]IgorPlugin
- type HelpPlugin
- func (plugin HelpPlugin) Config() IgorConfig
- func (plugin HelpPlugin) Describe(language string) map[string]string
- func (plugin HelpPlugin) Description(language string) string
- func (plugin HelpPlugin) Message() string
- func (plugin HelpPlugin) Name() string
- func (plugin HelpPlugin) Work() (slack.Response, error)
- type IgorConfig
- type IgorPlugin
- func Help(request slack.Request) IgorPlugin
- func RandomTumblr(request slack.Request) (IgorPlugin, error)
- func Remember(request slack.Request) (IgorPlugin, error)
- func Status(request slack.Request) (IgorPlugin, error)
- func Weather(request slack.Request) (IgorPlugin, error)
- func Xkcd(request slack.Request) (IgorPlugin, error)
- type NoMatchError
- type RandomTumblrPlugin
- func (plugin RandomTumblrPlugin) Config() IgorConfig
- func (plugin RandomTumblrPlugin) Describe(language string) map[string]string
- func (plugin RandomTumblrPlugin) Description(language string) string
- func (plugin RandomTumblrPlugin) Message() string
- func (plugin RandomTumblrPlugin) Name() string
- func (plugin RandomTumblrPlugin) Work() (slack.Response, error)
- type RememberPlugin
- func (plugin RememberPlugin) Config() IgorConfig
- func (plugin RememberPlugin) Describe(language string) map[string]string
- func (plugin RememberPlugin) Description(language string) string
- func (plugin RememberPlugin) Message() string
- func (plugin RememberPlugin) Name() string
- func (plugin RememberPlugin) Work() (slack.Response, error)
- type StatusPlugin
- func (plugin StatusPlugin) Config() IgorConfig
- func (plugin StatusPlugin) Describe(language string) map[string]string
- func (plugin StatusPlugin) Description(language string) string
- func (plugin StatusPlugin) Message() string
- func (plugin StatusPlugin) Name() string
- func (plugin StatusPlugin) Work() (slack.Response, error)
- type WeatherPlugin
- func (plugin WeatherPlugin) Config() IgorConfig
- func (plugin WeatherPlugin) Describe(language string) map[string]string
- func (plugin WeatherPlugin) Description(language string) string
- func (plugin WeatherPlugin) Message() string
- func (plugin WeatherPlugin) Name() string
- func (plugin WeatherPlugin) Work() (slack.Response, error)
- type XkcdPlugin
- func (plugin XkcdPlugin) Config() IgorConfig
- func (plugin XkcdPlugin) Describe(language string) map[string]string
- func (plugin XkcdPlugin) Description(language string) string
- func (plugin XkcdPlugin) Message() string
- func (plugin XkcdPlugin) Name() string
- func (plugin XkcdPlugin) Work() (slack.Response, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetPlugins ¶
GetPlugins retrieves all the plugins that are activated. It checks the config for a whitelist and blacklist as well.
Types ¶
type HelpPlugin ¶
type HelpPlugin struct {
// contains filtered or unexported fields
}
HelpPlugin provides help functions
func (HelpPlugin) Config ¶
func (plugin HelpPlugin) Config() IgorConfig
Config returns the plugin configuration
func (HelpPlugin) Describe ¶
func (plugin HelpPlugin) Describe(language string) map[string]string
Describe provides the triggers HelpPlugin can handle
func (HelpPlugin) Description ¶
func (plugin HelpPlugin) Description(language string) string
Description returns a global description of the plugin
func (HelpPlugin) Message ¶
func (plugin HelpPlugin) Message() string
Message returns a formatted version of the original message
type IgorConfig ¶
type IgorConfig interface { Languages() map[string]config.LanguagePluginDetails ChosenLanguage() string }
IgorConfig is the interface for all plugin Configuration
type IgorPlugin ¶
type IgorPlugin interface { Work() (slack.Response, error) Describe(string) map[string]string Name() string Description(string) string Message() string Config() IgorConfig }
IgorPlugin is the interface that needs to be followed by all plugins
func RandomTumblr ¶
func RandomTumblr(request slack.Request) (IgorPlugin, error)
RandomTumblr instantiates a RandomTumblrPlugin
func Remember ¶
func Remember(request slack.Request) (IgorPlugin, error)
Remember instantiates the RememberPlugin
func Status ¶
func Status(request slack.Request) (IgorPlugin, error)
Status instantiates the StatusPlugin
type NoMatchError ¶
type NoMatchError struct {
Message string
}
NoMatchError is an error type to indicate a plugin didn't find a match
func CreateNoMatchError ¶
func CreateNoMatchError(message string) *NoMatchError
CreateNoMatchError creates a new NoMatchError instance
func (*NoMatchError) Error ¶
func (e *NoMatchError) Error() string
Error returns a string interpretation of the NoMatchError
type RandomTumblrPlugin ¶
type RandomTumblrPlugin struct {
// contains filtered or unexported fields
}
RandomTumblrPlugin provides random entries from Tumblr blogs
func (RandomTumblrPlugin) Config ¶
func (plugin RandomTumblrPlugin) Config() IgorConfig
Config returns the plugin configuration
func (RandomTumblrPlugin) Describe ¶
func (plugin RandomTumblrPlugin) Describe(language string) map[string]string
Describe provides the triggers RandomTumblrPlugin can handle
func (RandomTumblrPlugin) Description ¶
func (plugin RandomTumblrPlugin) Description(language string) string
Description returns a global description of the plugin
func (RandomTumblrPlugin) Message ¶
func (plugin RandomTumblrPlugin) Message() string
Message returns a formatted version of the original message
func (RandomTumblrPlugin) Name ¶
func (plugin RandomTumblrPlugin) Name() string
Name returns the name of the plugin
type RememberPlugin ¶
type RememberPlugin struct {
// contains filtered or unexported fields
}
RememberPlugin provides remember functions
func (RememberPlugin) Config ¶
func (plugin RememberPlugin) Config() IgorConfig
Config returns the plugin configuration
func (RememberPlugin) Describe ¶
func (plugin RememberPlugin) Describe(language string) map[string]string
Describe provides the triggers RememberPlugin can handle
func (RememberPlugin) Description ¶
func (plugin RememberPlugin) Description(language string) string
Description returns a global description of the plugin
func (RememberPlugin) Message ¶
func (plugin RememberPlugin) Message() string
Message returns a formatted version of the original message
func (RememberPlugin) Name ¶
func (plugin RememberPlugin) Name() string
Name returns the name of the plugin
type StatusPlugin ¶
type StatusPlugin struct { Checks map[string]func() (slack.Attachment, error) MainChecks map[string]func() (slack.Attachment, error) // contains filtered or unexported fields }
StatusPlugin provides status reports for various services
func (StatusPlugin) Config ¶
func (plugin StatusPlugin) Config() IgorConfig
Config returns the plugin configuration
func (StatusPlugin) Describe ¶
func (plugin StatusPlugin) Describe(language string) map[string]string
Describe provides the triggers StatusPlugin can handle
func (StatusPlugin) Description ¶
func (plugin StatusPlugin) Description(language string) string
Description returns a global description of the plugin
func (StatusPlugin) Message ¶
func (plugin StatusPlugin) Message() string
Message returns a formatted version of the original message
func (StatusPlugin) Name ¶
func (plugin StatusPlugin) Name() string
Name returns the name of the plugin
type WeatherPlugin ¶
type WeatherPlugin struct { Source string // contains filtered or unexported fields }
WeatherPlugin provides weather information for the city you specify
func (WeatherPlugin) Config ¶
func (plugin WeatherPlugin) Config() IgorConfig
Config returns the plugin configuration
func (WeatherPlugin) Describe ¶
func (plugin WeatherPlugin) Describe(language string) map[string]string
Describe provides the triggers WeatherPlugin can handle
func (WeatherPlugin) Description ¶
func (plugin WeatherPlugin) Description(language string) string
Description returns a global description of the plugin
func (WeatherPlugin) Message ¶
func (plugin WeatherPlugin) Message() string
Message returns the request sent
func (WeatherPlugin) Name ¶
func (plugin WeatherPlugin) Name() string
Name returns the name of the plugin
type XkcdPlugin ¶
type XkcdPlugin struct {
// contains filtered or unexported fields
}
XkcdPlugin provides access to XKCD comics
func (XkcdPlugin) Config ¶
func (plugin XkcdPlugin) Config() IgorConfig
Config returns the plugin configuration
func (XkcdPlugin) Describe ¶
func (plugin XkcdPlugin) Describe(language string) map[string]string
Describe provides the triggers the plugin can handle
func (XkcdPlugin) Description ¶
func (plugin XkcdPlugin) Description(language string) string
Description returns a global description of the plugin
func (XkcdPlugin) Message ¶
func (plugin XkcdPlugin) Message() string
Message returns the original request message