router

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 5, 2021 License: MIT Imports: 6 Imported by: 4

Documentation

Index

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)
}

func (MentionRoute) Execute

func (route MentionRoute) Execute(api slack.Client, router Router, ev slackevents.AppMentionEvent, message string)

type Route

type Route struct {
	Name        string
	Pattern     string
	Description string
	Help        string
	Permissions []string
	Priority    int
}

type Router

type Router struct {
	MentionRoutes       map[string]MentionRoute
	DefaultMentionRoute MentionRoute
	DeniedMentionRoute  MentionRoute
	DbConnection        *gorm.DB
}

func NewRouter

func NewRouter() *Router

func (Router) AddMentionRoute

func (router Router) AddMentionRoute(route MentionRoute)

func (Router) AddMentionRoutes

func (router Router) AddMentionRoutes(routes []MentionRoute)

func (Router) Can

func (router Router) Can(u models.User, permissions []string) bool

func (Router) FindMentionRouteByMessage

func (router Router) FindMentionRouteByMessage(message string) (MentionRoute, bool)

func (Router) FindMentionRouteByName

func (router Router) FindMentionRouteByName(name string) (MentionRoute, bool)

func (Router) SetupDb

func (router Router) SetupDb()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL