Documentation
¶
Index ¶
- type MentionRoute
- type Route
- type Router
- func (router Router) AddMentionRoute(route MentionRoute)
- func (router Router) AddMentionRoutes(routes []MentionRoute)
- func (router Router) Can(u models.User, permissions []string) bool
- func (router Router) FindMentionRouteByMessage(message string) (MentionRoute, bool)
- func (router Router) FindMentionRouteByName(name string) (MentionRoute, bool)
- func (router Router) SetupDb()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MentionRoute ¶
type MentionRoute struct {
Route
// Plugin func(api slack.Client, router *Router, ev slackevents.AppMentionEvent, message string)
Plugin func(router Router, route Route, api slack.Client, ev slackevents.AppMentionEvent, message string)
}
func (MentionRoute) Execute ¶
func (route MentionRoute) Execute(api slack.Client, router Router, ev slackevents.AppMentionEvent, message string)
Execute calls the Plugin function provided
type Route ¶
type Route struct {
Name string
Pattern string
Description string
Help string
Permissions []string
Priority int
}
Route The primary type used by event specific routes
type Router ¶
type Router struct {
MentionRoutes map[string]MentionRoute
DefaultMentionRoute MentionRoute
DeniedMentionRoute MentionRoute
DbConnection *gorm.DB
}
Router the HTTP router which handles Events from Slack
func (Router) AddMentionRoute ¶
func (router Router) AddMentionRoute(route MentionRoute)
func (Router) AddMentionRoutes ¶
func (router Router) AddMentionRoutes(routes []MentionRoute)
func (Router) FindMentionRouteByMessage ¶
func (router Router) FindMentionRouteByMessage(message string) (MentionRoute, bool)
Find MentionRouteByMessage Returns the route to execute based on the first matched Route.Pattern.
func (Router) FindMentionRouteByName ¶
func (router Router) FindMentionRouteByName(name string) (MentionRoute, bool)
Find MentionRouteByName Returns the named mention route
Click to show internal directories.
Click to hide internal directories.