If you have any questions, feel free to ask in the Extensions channel of our Mattermost community instance. Finally, you need to run make pluginapi to generate the RPC glue code needed for your new API and make plugin-mocks to generate the mocks used for plugin testing. You then need to implement the API in the plugin_api.go of the app package. To add a plugin API you need to add the signature of your new method to the API interface. Plugin settings, configuration and enabled/disabled status are managed by the Mattermost config.json using a PluginSettings struct.Ĭheck out the plugin package and the plugin_* files in the app package for the code, and mattermost-plugin-demo for an example plugin. Once it is enabled, the server will then start the server process and prepare the web app bundle for serving to the client. To start a plugin it must be enabled (again via the UI, REST API or CLI). The server then unpacks the bundle, performs some validation and extracts it into the configured directory for storing installed plugins. Installing a plugin is the process of uploading this bundle to the Mattermost server (via the UI, REST API or CLI). In the future there will be another component of plugins for the mobile apps, likely a React Native bundle.Īll these different components of a plugin are compressed into a. More information is available in the webapp side of the plugin author documentation. In some special cases, the Pluggable component is not used and we instead implement the plugs manually. The Pluggable component is then inserted into various places in the app, allowing plugins to insert components into these locations in the UI. These are all stored as part of the app's plugin reducer. The registry contains many methods for registering different components and callbacks. The plugin's client code then registers itself and its components with the Mattermost client through the client's plugin registry. When a plugin is enabled, the client is notified and it makes a request to add the JS bundle to the document. The JavaScript bundle is a webpack-built collection of JavaScript code that will be run on the Mattermost web/desktop apps. More information is available in the server side of the plugin author documentation. The server-side of plugins is built using the go-plugin library from Hashicorp. Plugin builders then have access to interact with the Mattermost server over RPC through the plugin API and Hooks. When enabled, the plugin's server binary is started as a process by the Mattermost server. The server binary is a compiled (generally Go) program that extends the MattermostPlugin struct of the plugin package. Manifests may be defined in JSON or YAML. Please see the manifest reference for more information. The manifest tells Mattermost what the plugin is and provides a set of metadata used by the server to install and run the plugin. Plugins are generally made of at least two parts: a manifest and a server binary and/or a JavaScript bundle. Looking to build a plugin? Then you want the plugin author documentation. This document covers the plugin infrastructure and how to contribute to it. Mattermost supports plugins that offer powerful features for extending and deeply integrating with both the server and web/desktop apps.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |