Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessControl ¶
type AccessControl struct { TeamID []string `yaml:"team_id"` TeamName []string `yaml:"team_name"` ChannelID []string `yaml:"channel_id"` ChannelName []string `yaml:"channel_name"` UserID []string `yaml:"user_id"` UserName []string `yaml:"user_name"` }
func (*AccessControl) IsEmpty ¶
func (a *AccessControl) IsEmpty() bool
return true if all rules are empty
type Command ¶
type Command struct { Command string Name string Description string Usage string Plugin string CommandHandler func(ctx context.Context, mmCommand *MMSlashCommand, args map[string]string) (*CommandResponse, error) DialogHandler func(ctx context.Context, submission *DialogSubmission, args map[string]string) (*CommandResponse, error) }
type CommandResponse ¶
type CommandResponse struct { Type CommandResponseType Dialog Dialog Message Message }
type CommandResponseType ¶
type CommandResponseType string
const ( CommandResponseTypeEphemeral CommandResponseType = "ephemeral" CommandResponseTypeInChannel CommandResponseType = "in_channel" CommandResponseTypeDialog CommandResponseType = "dialog" )
type DialogElement ¶
type DialogElement struct { DisplayName string `yaml:"display_name"` Name string `yaml:"name"` Type string `yaml:"type"` SubType string `yaml:"subtype"` Default string `yaml:"default"` Placeholder string `yaml:"placeholder"` HelpText string `yaml:"help_text"` Optional bool `yaml:"optional"` MinLength int `yaml:"min_length"` MaxLength int `yaml:"max_length"` Options []*DialogOption `yaml:"options"` }
type DialogOption ¶
type DialogSubmission ¶
type DialogSubmission struct { Type string `json:"type"` CallbackID string `json:"callback_id"` State string `json:"state"` UserID string `json:"user_id"` ChannelID string `json:"channel_id"` TeamID string `json:"team_id"` //nolint:misspell // cancelled is misspelled but it is sent from mattermost-server. Canceled bool `json:"cancelled"` Submission map[string]string `json:"submission"` }
func ParseDialogSubmission ¶
func ParseDialogSubmission(r *http.Request) (*DialogSubmission, error)
type MMSlashCommand ¶
type MMSlashCommand struct { ChannelID string `schema:"channel_id"` ChannelName string `schema:"channel_name"` Command string `schema:"command"` TeamName string `schema:"team_domain"` TeamID string `schema:"team_id"` Text string `schema:"text"` Token string `schema:"token"` UserID string `schema:"user_id"` Username string `schema:"user_name"` ResponseURL string `schema:"response_url"` TriggerID string `schema:"trigger_id"` }
func ParseMattermostSlashCommand ¶
func ParseMattermostSlashCommand(r *http.Request) (*MMSlashCommand, error)
Click to show internal directories.
Click to hide internal directories.