settings

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: May 18, 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"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FreetextInfo added in v0.1.9

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() freetext_fetcher.FreetextFetcher
}

func NewBoolSetting

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

func NewEmptySetting

func NewEmptySetting(id, title, description string) Setting

func NewFreetextSetting added in v0.1.9

func NewFreetextSetting(id, title, description, modifyMessage, dependsOn string, store SettingStore, baseURL string, pluginURL string, ftfStore freetext_fetcher.FreetextStore, validate func(string) string, r *mux.Router, posterBot poster.Poster) Setting

func NewOptionSetting

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

func NewReadOnlySetting

func NewReadOnlySetting(id string, title string, description string, 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