Documentation ¶
Index ¶
- Constants
- type AppMetadataForClient
- type CallResponse
- type Service
- func (s *Service) Call(r *incoming.Request, w http.ResponseWriter, req *http.Request)
- func (s *Service) DisableApp(r *incoming.Request, w http.ResponseWriter, req *http.Request)
- func (s *Service) EnableApp(r *incoming.Request, w http.ResponseWriter, req *http.Request)
- func (s *Service) GetApp(r *incoming.Request, w http.ResponseWriter, req *http.Request)
- func (s *Service) GetBindings(r *incoming.Request, w http.ResponseWriter, req *http.Request)
- func (s *Service) GetBotIDs(r *incoming.Request, w http.ResponseWriter, req *http.Request)
- func (s *Service) GetMarketplace(r *incoming.Request, w http.ResponseWriter, req *http.Request)
- func (s *Service) GetOAuthAppIDs(r *incoming.Request, w http.ResponseWriter, req *http.Request)
- func (s *Service) GetSubscriptions(r *incoming.Request, w http.ResponseWriter, req *http.Request)
- func (s *Service) HandleFunc(path string, handlerFunc handlerFunc) *mux.Route
- func (s *Service) InstallApp(r *incoming.Request, w http.ResponseWriter, req *http.Request)
- func (s *Service) KVDelete(r *incoming.Request, w http.ResponseWriter, req *http.Request)
- func (s *Service) KVGet(r *incoming.Request, w http.ResponseWriter, req *http.Request)
- func (s *Service) KVPut(r *incoming.Request, w http.ResponseWriter, req *http.Request)
- func (s *Service) OAuth2GetUser(r *incoming.Request, w http.ResponseWriter, req *http.Request)
- func (s *Service) OAuth2StoreApp(r *incoming.Request, w http.ResponseWriter, req *http.Request)
- func (s *Service) OAuth2StoreUser(r *incoming.Request, w http.ResponseWriter, req *http.Request)
- func (s *Service) PathPrefix(prefix string) *Service
- func (s *Service) Ping(r *incoming.Request, w http.ResponseWriter, req *http.Request)
- func (s *Service) RemoteOAuth2Complete(r *incoming.Request, w http.ResponseWriter, req *http.Request)
- func (s *Service) RemoteOAuth2Connect(r *incoming.Request, w http.ResponseWriter, req *http.Request)
- func (s *Service) ServeHTTP(w http.ResponseWriter, req *http.Request)
- func (s *Service) ServePluginHTTP(c *plugin.Context, w http.ResponseWriter, req *http.Request)
- func (s *Service) Static(r *incoming.Request, w http.ResponseWriter, req *http.Request)
- func (s *Service) Subscribe(r *incoming.Request, w http.ResponseWriter, req *http.Request)
- func (s *Service) UninstallApp(r *incoming.Request, w http.ResponseWriter, req *http.Request)
- func (s *Service) Unsubscribe(r *incoming.Request, w http.ResponseWriter, req *http.Request)
- func (s *Service) UpdateAppListing(r *incoming.Request, w http.ResponseWriter, req *http.Request)
- func (s *Service) Webhook(r *incoming.Request, w http.ResponseWriter, req *http.Request)
- func (s *Service) WebhookValidateAuthentication(r *incoming.Request, w http.ResponseWriter, req *http.Request)
- type VersionInfo
Constants ¶
const AppIDPath = "/{appid}"
const AppIDVar = "appid"
const (
// MaxKVStoreValueLength is the maximum length in bytes that a value in the KV store of an app can contain
MaxKVStoreValueLength = 8192
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppMetadataForClient ¶ added in v1.2.0
type CallResponse ¶ added in v1.2.0
type CallResponse struct { apps.CallResponse // Used to provide info about the App to client, e.g. the bot user id AppMetadata AppMetadataForClient `json:"app_metadata"` }
CallResponse contains everything the CallResponse struct contains, plus some additional data for the client, such as information about the App's bot account.
Apps will use the CallResponse struct to respond to a CallRequest, and the proxy will decorate the response using the CallResponse to provide additional information.
type Service ¶
type Service struct { AppServices appservices.Service Config config.Service Proxy proxy.Service // contains filtered or unexported fields }
func NewService ¶
func (*Service) Call ¶ added in v1.2.0
Call handles a call request for an App.
Path: /api/v1/call Method: POST Input: CallRequest Output: CallResponse
func (*Service) DisableApp ¶ added in v1.2.0
DisableApp disables an App .
Path: /api/v1/disable-app Method: POST Input: JSON {app_id} Output: text message of operation's success.
func (*Service) EnableApp ¶ added in v1.2.0
EnableApp enables an App .
Path: /api/v1/enable-app Method: POST Input: JSON {app_id} Output: text message of operation's success.
func (*Service) GetApp ¶ added in v1.2.0
GetApp returns the App's record. If requestor is a system administrator, the raw record with secrets is returned, otherwise the output is sanitized.
Path: /apps/{AppID} Method: GET Input: none Output: App
func (*Service) GetBindings ¶ added in v1.2.0
GetBindings returns combined bindings for all Apps.
Path: /api/v1/bindings Method: GET Input: none Output: []Binding
func (*Service) GetBotIDs ¶ added in v1.2.0
GetBotIDs returns the list of all Apps' bot user IDs.
Path: /api/v1/bot-ids Method: GET Input: none Output: []string - the list of Bot user IDs for all installed Apps.
func (*Service) GetMarketplace ¶ added in v1.2.0
func (*Service) GetOAuthAppIDs ¶ added in v1.2.0
GetBindings returns combined bindings for all Apps.
Path: /api/v1/get-oauth-app-ids Method: GET Input: none Output: []string - the list of OAuth ClientIDs for all installed Apps.
func (*Service) GetSubscriptions ¶ added in v1.2.0
GetSubscriptions returns a users current list of subscriptions.
Path: /api/v1/subscribe Method: GET Input: None Output: []Subscription
func (*Service) HandleFunc ¶ added in v1.2.0
func (*Service) InstallApp ¶ added in v1.2.0
InstallApp installs an App that is already deployed, either locally or in the Marketplace (if applicable).
Path: /api/v1/install-app Method: POST Input: JSON {app_id, deploy_type} Output: JSON, unsanitized App record
func (*Service) KVDelete ¶ added in v1.2.0
KVDelete removes a (App-specific) value from the KV store.
Path: /api/v1/kv/[{prefix}/]{key} Methods: DELETE Input: none Output: none
func (*Service) KVGet ¶ added in v1.2.0
KVGet returns a value stored by the App in the KV store.
Path: /api/v1/kv/[{prefix}/]{key} Method: GET Input: none Output: a JSON object
func (*Service) KVPut ¶ added in v1.2.0
KVPut stores an App-provided JSON document in the KV store.
Path: /api/v1/kv/[{prefix}/]{key} Methods: POST, PUT Output: a JSON object Output: changed: set to true if the key value was changed.
func (*Service) OAuth2GetUser ¶ added in v1.2.0
func (*Service) OAuth2StoreApp ¶ added in v1.2.0
func (*Service) OAuth2StoreUser ¶ added in v1.2.0
func (*Service) PathPrefix ¶ added in v1.2.0
func (*Service) RemoteOAuth2Complete ¶ added in v1.2.0
func (*Service) RemoteOAuth2Connect ¶ added in v1.2.0
func (*Service) ServeHTTP ¶
func (s *Service) ServeHTTP(w http.ResponseWriter, req *http.Request)
ServeHTTP is the go http.Handler (mux compliant).
func (*Service) ServePluginHTTP ¶ added in v1.2.0
ServePluginHTTP is the interface invoked from the plugin's ServeHTTP
func (*Service) Subscribe ¶ added in v1.2.0
Subscribe starts or updates an App subscription to Mattermost events.
Path: /api/v1/subscribe Method: POST Input: Subscription Output: None
func (*Service) UninstallApp ¶ added in v1.2.0
UninstallApp uninstalls an App .
Path: /api/v1/uninstall-app Method: POST Input: JSON {app_id} Output: None
func (*Service) Unsubscribe ¶ added in v1.2.0
Unsubscribe removes an App's subscription to Mattermost events.
Path: /api/v1/unsubscribe Method: POST Input: Subscription Output: None
func (*Service) UpdateAppListing ¶ added in v1.2.0
UpdateAppListing adds (or updates) the specified Manifest to the local manifest store, making the App installable. The resulting listed manifest will combine the deployment information from the prior listing, and the new manifests as follows:
- The "core" manifest (except Deploy) is updated to the new values.
- Deploy types from the previously listed manifest are updated from the new manifest, or preserved.
- Deploy types specified in "add_deploys" are copied from the new manifest.
- "remove"
_
Path: /api/v1/add-listed-app Method: POST Input: JSON{ Manifest... "add_deploys": []string e.g. ["aws_lambda","http"] "remove_deploys": []string e.g. ["aws_lambda","http"] } Output: The updated listing manifest
func (*Service) WebhookValidateAuthentication ¶ added in v1.2.0
type VersionInfo ¶ added in v1.2.0
type VersionInfo struct {
Version string `json:"version"`
}