* plugin scaffolding / jira integration * add vendored testify packages * webhook fix * don't change i18n ids * support configuration watching * add basic jira plugin configuration to admin console * fix eslint errors * fix another eslint warning * polish * undo unintentional config.json commit >:( * test fix * add jira plugin diagnostics, remove dm support, add bot tag, generate web-safe secrets * rebase, implement requested changes * requested changes * remove tests and minimize makefile change * add missing license headers * add missing comma * remove bad line from Makefile
38 строки
1011 B
Go
38 строки
1011 B
Go
// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
|
|
// See License.txt for license information.
|
|
|
|
package plugin
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/gorilla/mux"
|
|
"github.com/mattermost/platform/model"
|
|
)
|
|
|
|
type API interface {
|
|
// Loads the plugin's configuration
|
|
LoadPluginConfiguration(dest interface{}) error
|
|
|
|
// The plugin's router
|
|
PluginRouter() *mux.Router
|
|
|
|
// Gets a team by its name
|
|
GetTeamByName(name string) (*model.Team, *model.AppError)
|
|
|
|
// Gets a user by its name
|
|
GetUserByName(name string) (*model.User, *model.AppError)
|
|
|
|
// Gets a channel by its name
|
|
GetChannelByName(teamId, name string) (*model.Channel, *model.AppError)
|
|
|
|
// Gets a direct message channel
|
|
GetDirectChannel(userId1, userId2 string) (*model.Channel, *model.AppError)
|
|
|
|
// Creates a post
|
|
CreatePost(post *model.Post, teamId string) (*model.Post, *model.AppError)
|
|
|
|
// Returns a localized string. If a request is given, its headers will be used to pick a locale.
|
|
I18n(id string, r *http.Request) string
|
|
}
|