Documentation ¶
Index ¶
- Variables
- type Client
- type ErrorResponse
- type Handler
- type HandlerFunc
- type OAuthConfig
- type Plugin
- func (p *Plugin) AddAuthorization(r *http.Request, mattermostUserID string) error
- func (p *Plugin) DM(mattermostUserID, format string, args ...interface{}) (string, error)
- func (p *Plugin) ExecuteCommand(c *plugin.Context, commandArgs *model.CommandArgs) (*model.CommandResponse, *model.AppError)
- func (p *Plugin) GenerateOAuthConnectURL(mattermostUserID string) string
- func (p *Plugin) GenerateOAuthToken(code, state string) error
- func (p *Plugin) GetPluginURL() string
- func (p *Plugin) GetPluginURLPath() string
- func (p *Plugin) GetSiteURL() string
- func (p *Plugin) HandleStaticFiles()
- func (p *Plugin) InitAPI() *mux.Router
- func (p *Plugin) InitRoutes()
- func (p *Plugin) IsAnyProjectLinked(mattermostUserID string) (bool, error)
- func (p *Plugin) IsProjectLinked(projectList []serializers.ProjectDetails, project serializers.ProjectDetails) bool
- func (p *Plugin) MessageWillBePosted(c *plugin.Context, post *model.Post) (*model.Post, string)
- func (p *Plugin) OAuthComplete(w http.ResponseWriter, r *http.Request)
- func (p *Plugin) OAuthConfig() *OAuthConfig
- func (p *Plugin) OAuthConnect(w http.ResponseWriter, r *http.Request)
- func (p *Plugin) OnActivate() error
- func (p *Plugin) OnConfigurationChange() error
- func (p *Plugin) ParseAuthToken(encoded string) (string, error)
- func (p *Plugin) RefreshOAuthToken(mattermostUserID string) error
- func (p *Plugin) ServeHTTP(c *plugin.Context, w http.ResponseWriter, r *http.Request)
- func (p *Plugin) StoreOAuthToken(mattermostUserID string, oauthTokenFormValues url.Values) error
- func (p *Plugin) UserAlreadyConnected(mattermostUserID string) bool
- func (p *Plugin) WithRecovery(next http.Handler) http.Handler
Constants ¶
This section is empty.
Variables ¶
var ErrNotFound = errors.New("not found")
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { TestApi() (string, error) // TODO: remove later GenerateOAuthToken(formValues url.Values) (*serializers.OAuthSuccessResponse, int, error) CreateTask(body *serializers.TaskCreateRequestPayload, mattermostUserID string) (*serializers.TaskValue, int, error) GetTask(queryParams serializers.GetTaskData, mattermostUserID string) (*serializers.TaskValue, int, error) Link(body *serializers.LinkRequestPayload, mattermostUserID string) (*serializers.Project, int, error) }
func InitClient ¶
type ErrorResponse ¶
type ErrorResponse struct {
Message string `json:"message"`
}
type HandlerFunc ¶
type HandlerFunc func(p *Plugin, c *plugin.Context, commandArgs *model.CommandArgs, args ...string) (*model.CommandResponse, *model.AppError)
type OAuthConfig ¶
type OAuthConfig struct {
// contains filtered or unexported fields
}
type Plugin ¶
type Plugin struct { plugin.MattermostPlugin Client Client Store *store.Store // contains filtered or unexported fields }
Plugin implements the interface expected by the Mattermost server to communicate between the server and plugin processes.
func (*Plugin) AddAuthorization ¶
AddAuthorization function to add authorization to a request.
func (*Plugin) ExecuteCommand ¶
func (p *Plugin) ExecuteCommand(c *plugin.Context, commandArgs *model.CommandArgs) (*model.CommandResponse, *model.AppError)
Handles executing a slash command
func (*Plugin) GenerateOAuthConnectURL ¶
GenerateOAuthConnectURL generates URL for Azure OAuth authorization
func (*Plugin) GenerateOAuthToken ¶
GenerateOAuthToken generates OAuth token after successful authorization
func (*Plugin) GetPluginURL ¶
func (*Plugin) GetPluginURLPath ¶
func (*Plugin) GetSiteURL ¶
func (*Plugin) HandleStaticFiles ¶
func (p *Plugin) HandleStaticFiles()
Handles the static files under the assets directory.
func (*Plugin) InitRoutes ¶
func (p *Plugin) InitRoutes()
Add custom routes and corresponding handlers here
func (*Plugin) IsAnyProjectLinked ¶
func (*Plugin) IsProjectLinked ¶
func (p *Plugin) IsProjectLinked(projectList []serializers.ProjectDetails, project serializers.ProjectDetails) bool
func (*Plugin) MessageWillBePosted ¶
func (*Plugin) OAuthComplete ¶
func (p *Plugin) OAuthComplete(w http.ResponseWriter, r *http.Request)
OAuthComplete captures the redirection request made by the OAuth authorization
func (*Plugin) OAuthConfig ¶
func (p *Plugin) OAuthConfig() *OAuthConfig
OAuthConfig initialize OAuth configs
func (*Plugin) OAuthConnect ¶
func (p *Plugin) OAuthConnect(w http.ResponseWriter, r *http.Request)
OAuthConnect redirects to the OAuth authorization URL
func (*Plugin) OnActivate ¶
Invoked when the plugin is activated
func (*Plugin) OnConfigurationChange ¶
Invoked when configuration changes may have been made.
func (*Plugin) RefreshOAuthToken ¶
RefreshOAuthToken refreshes OAuth token
func (*Plugin) StoreOAuthToken ¶
StoreOAuthToken stores oAuth token
func (*Plugin) UserAlreadyConnected ¶
UserAlreadyConnected checks if a user is already connected