Documentation
¶
Index ¶
- type MapResult
- type Matcher
- func NewAdminMatcher(admins config.UserList, slackClient client.SlackClient, matcher Matcher) Matcher
- func NewGroupMatcher(matcher ...Matcher) Matcher
- func NewPrefixMatcher(prefix string, run Runner) Matcher
- func NewRegexpMatcher(regexpString string, run Runner) Matcher
- func NewTextMatcher(text string, run Runner) Matcher
- func NewVoidMatcher() Matcher
- func WildcardMatcher(run wildcardRunner) Matcher
- type ReResult
- type Result
- type Runner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MapResult ¶
func (MapResult) MatchedString ¶
type Matcher ¶
Matcher is executed for each command and checks if it should execute the Runner for the given event text
func NewAdminMatcher ¶
func NewAdminMatcher(admins config.UserList, slackClient client.SlackClient, matcher Matcher) Matcher
NewAdminMatcher is a wrapper to only executable by a whitelisted admins user
func NewGroupMatcher ¶
NewGroupMatcher is a matcher which go through the list of given sub-matcher...just define multiple matcher in a chain/group
func NewPrefixMatcher ¶
NewPrefixMatcher accepts command which starts with the given prefix Example: prefix for "random" "random" -> match "random 1 2 3" -> match "randomness" -> no match
func NewRegexpMatcher ¶
NewRegexpMatcher matches a command based on a given prefix. 2 additional rules: - it's case insensitive - it always has to match the full line (adding ^ and $ implicitly)
func NewTextMatcher ¶
NewTextMatcher match messages by full text (case insensitive)
func NewVoidMatcher ¶
func NewVoidMatcher() Matcher
NewVoidMatcher just do nothing (might be useful when a command is not loadable because dependencies are not configures)
func WildcardMatcher ¶ added in v1.6.2
func WildcardMatcher(run wildcardRunner) Matcher
WildcardMatcher will pass all messages into the runner. The runner needs to check if the event is relevant or not if the runner returns "true", the command is marked as executed and no other commands are checked
type ReResult ¶
type ReResult struct {
// contains filtered or unexported fields
}