plugin

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandHandler

type CommandHandler struct {
	// contains filtered or unexported fields
}

command stores command specific information

func (*CommandHandler) Handle

func (c *CommandHandler) Handle(args ...string) (string, error)

type Handler

type Handler interface {
	Handle(args ...string) (string, error)
}

Handler returns API for interacting with plugin commands

type HandlerFunc

type HandlerFunc func(args ...string) (string, error)

HandlerFunc command handler function type

type HandlerMap

type HandlerMap struct {
	// contains filtered or unexported fields
}

HandlerMap map of command handler functions

type Plugin

type Plugin struct {
	mattermostPlugin.MattermostPlugin
	// contains filtered or unexported fields
}

func NewWithConfig

func NewWithConfig(conf *config.Config) *Plugin

NewWithConfig creates new plugin object from configuration

func NewWithSplunk

func NewWithSplunk(sp splunk.Splunk, conf *config.Config) *Plugin

NewWithSplunk creates new plugin object from splunk

func NewWithStore

func NewWithStore(store store.Store, conf *config.Config) *Plugin

NewWithStore creates new plugin object from configuration and store object

func (*Plugin) CreatePost

func (p *Plugin) CreatePost(post *model.Post) (*model.Post, error)

CreatePost creates a new public post

func (*Plugin) ExecuteCommand

func (p *Plugin) ExecuteCommand(_ *mattermostPlugin.Context, commandArgs *model.CommandArgs) (*model.CommandResponse, *model.AppError)

ExecuteCommand hook is called when slash command is submitted

func (*Plugin) GetConfiguration

func (p *Plugin) GetConfiguration() *config.Config

GetConfiguration retrieves the active Config under lock, making it safe to use concurrently. The active Config may change underneath the client of this method, but the struct returned by this API call is considered immutable.

func (*Plugin) GetSlashCommand

func (p *Plugin) GetSlashCommand() (*model.Command, error)

GetSlashCommand returns command to register

func (*Plugin) GetUsersInChannel

func (p *Plugin) GetUsersInChannel(channelID, sortBy string, page, perPage int) ([]*model.User, error)

GetUsersInChannel gets paginated user list for channel

func (*Plugin) KVDelete

func (p *Plugin) KVDelete(key string) *model.AppError

KVDelete removes a key-value pair, unique per plugin. Returns nil for non-existent keys.

func (*Plugin) KVGet

func (p *Plugin) KVGet(key string) ([]byte, *model.AppError)

KVGet retrieves a value based on the key, unique per plugin. Returns nil for non-existent keys.

func (*Plugin) KVSet

func (p *Plugin) KVSet(key string, value []byte) *model.AppError

KVSet stores a key-value pair, unique per plugin.

func (*Plugin) LogDebug

func (p *Plugin) LogDebug(msg string, keyValuePairs ...interface{})

LogDebug writes a log message to the Mattermost server log file.

func (*Plugin) LogError

func (p *Plugin) LogError(msg string, keyValuePairs ...interface{})

LogError writes a log message to the Mattermost server log file.

func (*Plugin) LogInfo

func (p *Plugin) LogInfo(msg string, keyValuePairs ...interface{})

LogInfo writes a log message to the Mattermost server log file.

func (*Plugin) LogWarn

func (p *Plugin) LogWarn(msg string, keyValuePairs ...interface{})

LogWarn writes a log message to the Mattermost server log file.

func (*Plugin) NewHandler

func (p *Plugin) NewHandler(args *model.CommandArgs) Handler

NewHandler returns new Handler with given dependencies

func (*Plugin) OnActivate

func (p *Plugin) OnActivate() error

OnActivate called when plugin is activated

func (*Plugin) OnConfigurationChange

func (p *Plugin) OnConfigurationChange() error

OnConfigurationChange is invoked when Config changes may have been made.

func (*Plugin) PublishWebSocketEvent

func (p *Plugin) PublishWebSocketEvent(event string, payload map[string]interface{}, broadcast *model.WebsocketBroadcast)

PublishWebSocketEvent sends broadcast

func (*Plugin) SendEphemeralPost

func (p *Plugin) SendEphemeralPost(userID string, post *model.Post) *model.Post

SendEphemeralPost responds user request with message

func (*Plugin) ServeHTTP

func (p *Plugin) ServeHTTP(_ *mattermostPlugin.Context, w http.ResponseWriter, req *http.Request)

Jump to

Keyboard shortcuts

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