settings

package
v0.0.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 15, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ContextIDKey          = "setting_id"
	ContextButtonValueKey = "button_value"
	ContextOptionValueKey = "selected_option"

	DisabledString = "Disabled"
	TrueString     = "true"
	FalseString    = "false"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FreetextInfo

type FreetextInfo struct {
	SettingID string
	UserID    string
}

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
}

func NewBoolSetting

func NewBoolSetting(id, title, description, dependsOn string, store SettingStore) Setting

func NewEmptySetting

func NewEmptySetting(id, title, description string) Setting

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

func NewOptionSetting

func NewOptionSetting(id, title, description, dependsOn string, options []string, store SettingStore) Setting

func NewReadOnlySetting

func NewReadOnlySetting(id, title, description, dependsOn string, store SettingStore) Setting

type SettingStore

type SettingStore interface {
	SetSetting(userID, settingID string, value interface{}) error
	GetSetting(userID, settingID string) (interface{}, error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL