Documentation
¶
Index ¶
- Constants
- Variables
- type Config
- type Configurable
- type Service
- type StoredConfig
- type TestService
- func (s *TestService) Get() Config
- func (s *TestService) I18N() *i18n.Bundle
- func (s *TestService) MattermostAPI() *pluginapi.Client
- func (s *TestService) MattermostConfig() configservice.ConfigService
- func (s *TestService) NewBaseLogger() utils.Logger
- func (s *TestService) Reconfigure(StoredConfig, bool, ...Configurable) error
- func (s *TestService) StoreConfig(sc StoredConfig, _ utils.Logger) error
- func (s *TestService) SystemDefaultFlags() (bool, bool)
- func (s *TestService) Telemetry() *telemetry.Telemetry
- func (s TestService) WithMattermostAPI(mm *pluginapi.Client) *TestService
- func (s TestService) WithMattermostConfig(mmconfig model.Config) *TestService
Constants ¶
View Source
const ( MattermostSessionIDHeader = "Mattermost-Session-Id" MattermostPluginIDHeader = "Mattermost-Plugin-Id" MattermostUserIDHeader = "Mattermost-User-Id" )
View Source
const ( Repository = "mattermost-plugin-apps" CommandTrigger = "apps" ManifestsFile = "manifests.json" BotUsername = "appsbot" BotDisplayName = "Mattermost Apps" BotDescription = "Mattermost Apps Registry and API proxy." )
Internal configuration apps.of mattermost-plugin-apps
View Source
const ( // Top-level path(s) for HTTP example apps. HelloHTTPPath = "/example/hello" WebSocketEventRefreshBindings = "refresh_bindings" WebSocketEventPluginEnabled = "plugin_enabled" WebSocketEventPluginDisabled = "plugin_disabled" )
View Source
const ( PropTeamID = "team_id" PropChannelID = "channel_id" PropUserAgent = "user_agent_type" )
View Source
const (
RequestTimeout = time.Second * 30
)
Variables ¶
View Source
var BuildDate string
View Source
var BuildHash string
View Source
var BuildHashShort string
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
StoredConfig
PluginManifest model.Manifest
BuildDate string
BuildHash string
BuildHashShort string
MattermostCloudMode bool
DeveloperMode bool
AllowHTTPApps bool
BotUserID string
MattermostSiteURL string
MattermostLocalURL string
PluginURL string
PluginURLPath string
// Maximum size of incoming remote webhook messages
MaxWebhookSize int
AWSRegion string
AWSAccessKey string
AWSSecretKey string
AWSS3Bucket string
}
Config represents the the metadata handed to all request runners (command, http).
Config should be abbreviated as `conf`.
func (Config) GetPluginVersionInfo ¶ added in v1.0.0
func (*Config) InfoTemplateData ¶ added in v1.0.0
type Service ¶
type Service interface {
Get() Config
MattermostAPI() *pluginapi.Client
MattermostConfig() configservice.ConfigService
I18N() *i18n.Bundle
Telemetry() *telemetry.Telemetry
NewBaseLogger() utils.Logger
SystemDefaultFlags() (devMode, allowHTTPApps bool)
Reconfigure(_ StoredConfig, verbose bool, _ ...Configurable) error
StoreConfig(StoredConfig, utils.Logger) error
}
type StoredConfig ¶
type StoredConfig struct {
// InstalledApps is a list of all apps installed on the Mattermost instance.
//
// For each installed app, an entry of string(AppID) -> sha1(App) is added,
// and the App struct is stored in KV under app_<sha1(App)>. Implementation
// in `store.App`.
InstalledApps map[string]string `json:"installed_apps,omitempty"`
// LocalManifests is a list of locally-stored manifests. Local is in
// contrast to the "global" list of manifests which in the initial version
// is loaded from S3.
//
// For each installed app, an entry of string(AppID) -> sha1(Manifest) is
// added, and the Manifest struct is stored in KV under
// manifest_<sha1(Manifest)>. Implementation in `store.Manifest`.
LocalManifests map[string]string `json:"local_manifests,omitempty"`
DeveloperModeOverride *bool `json:"developer_mode"`
AllowHTTPAppsOverride *bool `json:"allow_http_apps"`
LogChannelID string `json:"log_channel_id,omitempty"`
LogChannelLevel int `json:"log_channel_level,omitempty"`
LogChannelJSON bool `json:"log_channel_json,omitempty"`
}
StoredConfig represents the data stored in and managed with the Mattermost config.
StoredConfig should be abbreviated as sc.
type TestService ¶ added in v1.0.0
type TestService struct {
// contains filtered or unexported fields
}
func NewTestConfigService ¶ added in v1.0.0
func NewTestConfigService(testConfig *Config) *TestService
func NewTestService ¶ added in v1.0.0
func NewTestService(testConfig *Config) (*TestService, *plugintest.API)
func (*TestService) Get ¶ added in v1.0.0
func (s *TestService) Get() Config
func (*TestService) I18N ¶ added in v1.0.0
func (s *TestService) I18N() *i18n.Bundle
func (*TestService) MattermostAPI ¶ added in v1.0.0
func (s *TestService) MattermostAPI() *pluginapi.Client
func (*TestService) MattermostConfig ¶ added in v1.0.0
func (s *TestService) MattermostConfig() configservice.ConfigService
func (*TestService) NewBaseLogger ¶ added in v1.2.0
func (s *TestService) NewBaseLogger() utils.Logger
func (*TestService) Reconfigure ¶ added in v1.0.0
func (s *TestService) Reconfigure(StoredConfig, bool, ...Configurable) error
func (*TestService) StoreConfig ¶ added in v1.0.0
func (s *TestService) StoreConfig(sc StoredConfig, _ utils.Logger) error
func (*TestService) SystemDefaultFlags ¶ added in v1.2.1
func (s *TestService) SystemDefaultFlags() (bool, bool)
func (*TestService) Telemetry ¶ added in v1.0.0
func (s *TestService) Telemetry() *telemetry.Telemetry
func (TestService) WithMattermostAPI ¶ added in v1.0.0
func (s TestService) WithMattermostAPI(mm *pluginapi.Client) *TestService
func (TestService) WithMattermostConfig ¶ added in v1.0.0
func (s TestService) WithMattermostConfig(mmconfig model.Config) *TestService
Click to show internal directories.
Click to hide internal directories.