{"modulePath":"github.com/firephenix/mattermost-server","version":"v4.2.0+incompatible","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package pluginenv\n\nPackage pluginenv provides high level functionality for discovering and launching plugins.\n\n## Functions\n\n```go\nfunc DefaultSupervisorProvider(bundle *model.BundleInfo) (plugin.Supervisor, error)\n```\nDefaultSupervisorProvider chooses a supervisor based on the plugin's manifest contents. E.g. if the manifest specifies a backend executable, it will be given an rpcplugin.Supervisor.\n\n```go\nfunc ScanSearchPath(path string) ([]*model.BundleInfo, error)\n```\nPerforms a full scan of the given path.\n\nThis function will return info for all subdirectories that appear to be plugins (i.e. all subdirectories containing plugin manifest files, regardless of whether they could actually be parsed).\n\nPlugins are found non-recursively and paths beginning with a dot are always ignored.\n\n## Types\n\n```go\ntype APIProviderFunc func(*model.Manifest) (plugin.API, error)\n```\n\n```go\ntype ActivePlugin struct {\n\tBundleInfo *model.BundleInfo\n\tSupervisor plugin.Supervisor\n}\n```\n\n```go\ntype Environment struct {\n\t// contains filtered or unexported fields\n}\n```\nEnvironment represents an environment that plugins are discovered and launched in.\n\n```go\nfunc New(options ...Option) (*Environment, error)\n```\nCreates a new environment. At a minimum, the APIProvider and SearchPath options are required.\n\n```go\nfunc (env *Environment) ActivatePlugin(id string) error\n```\nActivates the plugin with the given id.\n\n```go\nfunc (env *Environment) ActivePluginIds() (ids []string)\n```\nReturns the ids of the currently active plugins.\n\n```go\nfunc (env *Environment) ActivePlugins() ([]*model.BundleInfo, error)\n```\nReturns a list of all currently active plugins within the environment.\n\n```go\nfunc (env *Environment) DeactivatePlugin(id string) error\n```\nDeactivates the plugin with the given id.\n\n```go\nfunc (env *Environment) Plugins() ([]*model.BundleInfo, error)\n```\nReturns a list of all plugins found within the environment.\n\n```go\nfunc (env *Environment) SearchPath() string\n```\nReturns the configured search path.\n\n```go\nfunc (env *Environment) Shutdown() (errs []error)\n```\nDeactivates all plugins and gracefully shuts down the environment.\n\n```go\nfunc (env *Environment) WebappPath() string\n```\nReturns the configured webapp path.\n\n```go\ntype Option func(*Environment)\n```\n\n```go\nfunc APIProvider(provider APIProviderFunc) Option\n```\nAPIProvider specifies a function that provides an API implementation to each plugin.\n\n```go\nfunc SearchPath(path string) Option\n```\nSearchPath specifies a directory that contains the plugins to launch.\n\n```go\nfunc SupervisorProvider(provider SupervisorProviderFunc) Option\n```\nSupervisorProvider specifies a function that provides a Supervisor implementation to each plugin. If unspecified, DefaultSupervisorProvider is used.\n\n```go\nfunc WebappPath(path string) Option\n```\nWebappPath specifies the static directory serving the webapp.\n\n```go\ntype SupervisorProviderFunc func(*model.BundleInfo) (plugin.Supervisor, error)\n```\n\n","path":"github.com/firephenix/mattermost-server/plugin/pluginenv","name":"pluginenv","synopsis":"Package pluginenv provides high level functionality for discovering and launching plugins.","isRedistributable":true}
