Documentation ¶
Index ¶
- type Configuration
- func (c *Configuration) ClientConfiguration() map[string]interface{}
- func (c *Configuration) Clone() *Configuration
- func (c *Configuration) IsOAuthConfigured() bool
- func (c *Configuration) IsValid() error
- func (c *Configuration) Sanitize()
- func (c *Configuration) SetDefaults() (bool, error)
- func (c *Configuration) ToMap() (map[string]interface{}, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Configuration ¶
type Configuration struct { GoogleOAuthClientID string `json:"googleoauthclientid"` GoogleOAuthClientSecret string `json:"googleoauthclientsecret"` EncryptionKey string `json:"encryptionkey"` QueriesPerMinute int `json:"queriesperminute"` BurstSize int `json:"burstsize"` }
Configuration captures the plugin's external configuration as exposed in the Mattermost server configuration, as well as values computed from the configuration. Any public fields will be deserialized from the Mattermost server configuration in OnConfigurationChange.
As plugins are inherently concurrent (hooks being called asynchronously), and the plugin configuration can change at any time, access to the configuration must be synchronized. The strategy used in this plugin is to guard a pointer to the configuration, and clone the entire struct whenever it changes. You may replace this with whatever strategy you choose.
If you add non-reference types to your configuration struct, be sure to rewrite Clone as a deep copy appropriate for your types.
func (*Configuration) ClientConfiguration ¶
func (c *Configuration) ClientConfiguration() map[string]interface{}
func (*Configuration) Clone ¶
func (c *Configuration) Clone() *Configuration
Clone shallow copies the configuration. Your implementation may require a deep copy if your configuration has reference types.
func (*Configuration) IsOAuthConfigured ¶
func (c *Configuration) IsOAuthConfigured() bool
func (*Configuration) IsValid ¶
func (c *Configuration) IsValid() error
IsValid checks if all needed fields are set.
func (*Configuration) Sanitize ¶
func (c *Configuration) Sanitize()
func (*Configuration) SetDefaults ¶
func (c *Configuration) SetDefaults() (bool, error)
func (*Configuration) ToMap ¶
func (c *Configuration) ToMap() (map[string]interface{}, error)