Documentation
¶
Index ¶
- Constants
- type FreetextInfo
- type Setting
- func NewBoolSetting(id, title, description, dependsOn string, store SettingStore) Setting
- func NewEmptySetting(id, title, description string) Setting
- func NewFreetextSetting(id, title, description, modifyMessage, dependsOn string, store SettingStore, ...) Setting
- func NewOptionSetting(id, title, description, dependsOn string, options []string, store SettingStore) Setting
- func NewReadOnlySetting(id, title, description, dependsOn string, store SettingStore) Setting
- type SettingStore
Constants ¶
View Source
const ( // ContextIDKey defines the key used in the context to store the ID ContextIDKey = "setting_id" // ContextButtonValueKey defines the key used in the context to store a button value ContextButtonValueKey = "button_value" // ContextOptionValueKey defines the key used in the context to store a selected option value ContextOptionValueKey = "selected_option" // DisabledString defines the string used to show that a setting is disabled DisabledString = "Disabled" // TrueString codify the boolean true into a string TrueString = "true" // FalseString codify the boolean false into a string FalseString = "false" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FreetextInfo ¶
FreetextInfo defines the information needed in the payload for freetext settings
type Setting ¶
type Setting interface {
Set(userID string, value interface{}) error
Get(userID string) (interface{}, error)
GetID() string
GetDependency() string
IsDisabled(foreignValue interface{}) bool
GetTitle() string
GetDescription() string
GetSlackAttachments(userID, settingHandler string, disabled bool) (*model.SlackAttachment, error)
GetFreetextFetcher() freetextfetcher.FreetextFetcher
}
Setting defines the behavior of each element a the panel
func NewBoolSetting ¶
func NewBoolSetting(id, title, description, dependsOn string, store SettingStore) Setting
NewBoolSetting creates a new setting input for boolean values
func NewEmptySetting ¶
NewEmptySetting creates a new panel value with no setting attached
func NewFreetextSetting ¶
func NewFreetextSetting( id, title, description, modifyMessage, dependsOn string, store SettingStore, baseURL, pluginURL string, ftfStore freetextfetcher.FreetextStore, validate func(string) string, r *mux.Router, p poster.Poster, ) Setting
NewFreetextSetting creates a new setting input to add any text
func NewOptionSetting ¶
func NewOptionSetting(id, title, description, dependsOn string, options []string, store SettingStore) Setting
NewOptionSetting creates a new setting input to select from a dropdown
func NewReadOnlySetting ¶
func NewReadOnlySetting(id, title, description, dependsOn string, store SettingStore) Setting
NewReadOnlySetting creates a new panel value that only read from the setting
Click to show internal directories.
Click to hide internal directories.