Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action string
Action describes how the message is handled after matching a RuleSet.
type ErrExtraParam ¶
type ErrExtraParam struct {
ExtraParams []string
}
ErrExtraParam is returned when a Match contains extra parameters.
func (ErrExtraParam) Error ¶
func (c ErrExtraParam) Error() string
type ErrMatchSetInvalid ¶
ErrMatchSetInvalid is returned when a MatchSet contains errors.
func (ErrMatchSetInvalid) Error ¶
func (c ErrMatchSetInvalid) Error() string
type ErrMissingParam ¶
type ErrMissingParam struct {
Tag string
}
ErrMissingParam is returned when a Match lacks a paramater.
func (ErrMissingParam) Error ¶
func (c ErrMissingParam) Error() string
type Match ¶
type Match struct { // Match mode // See Also: Mode Mode Mode `yaml:"mode"` // Match options Regex bool `yaml:"regex,omitempty"` // Match parameters // Only filled in as required by the Mode specified. // See Also: Mode ChannelName string `yaml:"channel_name,omitempty"` UserName string `yaml:"user_name,omitempty"` UserID uint `yaml:"user_id,omitempty"` IsAdmin *bool `yaml:"is_admin,omitempty"` MessageTitle string `yaml:"message_title,omitempty"` MessageText string `yaml:"message_text,omitempty"` MessageExtra string `yaml:"message_extra,omitempty"` MessagePriority *int `yaml:"priority,omitempty"` }
Match describes a Match.
type MatchSet ¶
type MatchSet []Match
MatchSet is a set of Matches. MatchSet matches message by validating every Match and only success when all Match is satisfied.
type Mode ¶
type Mode string
Mode describes a Match matches which aspect of the message.
const ( // ModeAny matches all messages. // No parameters are required. ModeAny Mode = "any" // ModeChannelName matches the channel name the message is sent through. // Use parameter channel_name to specity the channel name to match. // Use parameter regex: true to enable regex matching. ModeChannelName Mode = "channel_name" // ModeUserName matches the user name of the message (matches the sender on the recipient side and matches the recipient on the sender side). // Use parameter user_name to specify the user name to match. // Use parameter regex: true to enable regex matching. ModeUserName Mode = "user_name" // ModeUserID matches the user ID of the message (matches the sender on the recipient side and matches the recipient on the sender side). // Use parameter user_id to specify the user ID to match. // Use parameter regex: true to enable regex matching. ModeUserID Mode = "user_id" // ModeIsAdmin matches whether the user is an admin (matches the sender on the recipient side and matches the recipient on the sender side). // Use parameter is_admin to specity whether to match admins or non-admins. ModeIsAdmin Mode = "is_admin" // ModeMessageTitle matches the message title. // Use parameter message_title to specify the title to match. // Use parameter regex: true to enable regex matching. ModeMessageTitle Mode = "message_title" // ModeMessageText matches the message text. // Use parameter message_text to specity the text to match. // Use parameter regex: true to enable regex matching. ModeMessageText Mode = "message_text" // ModeMessageExtra matches whether the message possesses an extra. // Use parameter message_extra to specity the key of the extra to match. // Use parameter regex: true to enable regex matching. ModeMessageExtra Mode = "message_extra" // ModePriorityLt matches messages with priority less then a specified value. // Use parameter priority to specity the priority threshold. ModePriorityLt Mode = "message_priority_lt" // ModePriorityGt matches messages with priority greater then a specified value. // Use parameter priority to specity the priority threshold. ModePriorityGt Mode = "message_priority_gt" // ModePriority matches messages with priority at a specified value. // Use parameter priority to specity the priority. ModePriority Mode = "message_priority" )
type RuleChainError ¶
RuleChainError is the errors in a rulechain.
func (RuleChainError) Error ¶
func (c RuleChainError) Error() string
type RuleItemError ¶
RuleItemError is returned when a Rule in a RuleChain contains errors.
func (RuleItemError) Error ¶
func (c RuleItemError) Error() string
Click to show internal directories.
Click to hide internal directories.