Documentation
¶
Index ¶
- func GetSetting(key string) (string, error)
- func GetSettingBool(key string) bool
- func GetUserSetting(userID int64, key string) (string, error)
- func Init() error
- func SetSetting(key, value string, version int) error
- func SetUserSetting(userID int64, key, value string) error
- type DBStore
- type RuntimeState
- type StateItem
- type StateStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSetting ¶
GetSetting returns the setting value via the key
func GetSettingBool ¶
GetSettingBool return bool value of setting, none existing keys and errors are ignored and result in false
func GetUserSetting ¶
GetUserSetting returns the user setting value via the key
func SetSetting ¶
SetSetting sets the setting value
func SetUserSetting ¶
SetUserSetting sets the user setting value
Types ¶
type DBStore ¶
type DBStore struct{}
DBStore can be used to store app state items in local filesystem
type RuntimeState ¶
type RuntimeState struct {
LastAppPath string `json:"last_app_path"`
}
RuntimeState contains app state for runtime, and we can save remote version for update checker here in future
type StateItem ¶
type StateItem interface {
Name() string
}
StateItem provides the name for a state item. the name will be used to generate filenames, etc
type StateStore ¶
StateStore is the interface to get/set app state items
var AppState StateStore
AppState contains the state items for the app