Documentation ¶
Index ¶
- Constants
- type MatterpollPlugin
- func (p *MatterpollPlugin) CanManagePoll(poll *poll.Poll, issuerID string) (bool, *model.AppError)
- func (p *MatterpollPlugin) ConvertCreatorIDToDisplayName(creatorID string) (string, *model.AppError)
- func (p *MatterpollPlugin) ConvertUserIDToDisplayName(userID string) (string, *model.AppError)
- func (p *MatterpollPlugin) ExecuteCommand(c *plugin.Context, args *model.CommandArgs) (*model.CommandResponse, *model.AppError)
- func (p *MatterpollPlugin) InitAPI() *mux.Router
- func (p *MatterpollPlugin) OnActivate() error
- func (p *MatterpollPlugin) OnConfigurationChange() error
- func (p *MatterpollPlugin) OnDeactivate() error
- func (p *MatterpollPlugin) SendEphemeralPost(channelID, userID, rootID, message string)
- func (p *MatterpollPlugin) ServeHTTP(c *plugin.Context, w http.ResponseWriter, r *http.Request)
Constants ¶
const (
// MatterpollPostType is post_type of posts generated by Matterpoll
MatterpollPostType = "custom_matterpoll"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MatterpollPlugin ¶
type MatterpollPlugin struct { plugin.MattermostPlugin Store store.Store ServerConfig *model.Config // contains filtered or unexported fields }
MatterpollPlugin is the object to run the plugin
func NewMatterpollPlugin ¶ added in v1.4.0
func NewMatterpollPlugin() *MatterpollPlugin
func (*MatterpollPlugin) CanManagePoll ¶ added in v1.5.0
CanManagePoll checks if a given user has the permission to manage i.e. end or delete a given poll
func (*MatterpollPlugin) ConvertCreatorIDToDisplayName ¶
func (p *MatterpollPlugin) ConvertCreatorIDToDisplayName(creatorID string) (string, *model.AppError)
ConvertCreatorIDToDisplayName returns the display name to a given user ID of a poll creator
func (*MatterpollPlugin) ConvertUserIDToDisplayName ¶
func (p *MatterpollPlugin) ConvertUserIDToDisplayName(userID string) (string, *model.AppError)
ConvertUserIDToDisplayName returns the display name to a given user ID
func (*MatterpollPlugin) ExecuteCommand ¶
func (p *MatterpollPlugin) ExecuteCommand(c *plugin.Context, args *model.CommandArgs) (*model.CommandResponse, *model.AppError)
ExecuteCommand parses a given input and creates a poll if the input is correct
func (*MatterpollPlugin) InitAPI ¶
func (p *MatterpollPlugin) InitAPI() *mux.Router
InitAPI initializes the REST API
func (*MatterpollPlugin) OnActivate ¶
func (p *MatterpollPlugin) OnActivate() error
OnActivate ensures a configuration is set and initializes the API
func (*MatterpollPlugin) OnConfigurationChange ¶
func (p *MatterpollPlugin) OnConfigurationChange() error
OnConfigurationChange loads the plugin configuration, validates it and saves it.
func (*MatterpollPlugin) OnDeactivate ¶
func (p *MatterpollPlugin) OnDeactivate() error
OnDeactivate marks the plugin as deactivated
func (*MatterpollPlugin) SendEphemeralPost ¶ added in v1.1.0
func (p *MatterpollPlugin) SendEphemeralPost(channelID, userID, rootID, message string)
SendEphemeralPost sends an ephemeral post to a user as the bot account
func (*MatterpollPlugin) ServeHTTP ¶
func (p *MatterpollPlugin) ServeHTTP(c *plugin.Context, w http.ResponseWriter, r *http.Request)