Documentation
¶
Index ¶
- func GetDatabase() *sql.DB
- func GetEmojiList() []generated.Emoji
- func SetupEmojiDirectory() (err error)
- func SetupPersistence(file string) error
- func UpdateEmojiList(force bool) (time.Time, error)
- type Datastore
- func (ds *Datastore) Get(key string) (models.ConfigEntry, error)
- func (ds *Datastore) GetBool(key string) (bool, error)
- func (ds *Datastore) GetCachedValue(key string) ([]byte, error)
- func (ds *Datastore) GetNumber(key string) (float64, error)
- func (ds *Datastore) GetQueries() *db.Queries
- func (ds *Datastore) GetString(key string) (string, error)
- func (ds *Datastore) GetStringMap(key string) (map[string]string, error)
- func (ds *Datastore) GetStringSlice(key string) ([]string, error)
- func (ds *Datastore) MustExec(s string)
- func (ds *Datastore) Reset()
- func (ds *Datastore) Save(e models.ConfigEntry) error
- func (ds *Datastore) SetBool(key string, value bool) error
- func (ds *Datastore) SetCachedValue(key string, b []byte)
- func (ds *Datastore) SetNumber(key string, value float64) error
- func (ds *Datastore) SetString(key string, value string) error
- func (ds *Datastore) SetStringMap(key string, value map[string]string) error
- func (ds *Datastore) SetStringSlice(key string, value []string) error
- func (ds *Datastore) Setup()
- func (ds *Datastore) WarmCache()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDatabase ¶
GetDatabase will return the shared instance of the actual database.
func GetEmojiList ¶ added in v0.1.0
GetEmojiList returns a list of custom emoji from the emoji directory.
func SetupEmojiDirectory ¶ added in v0.1.0
func SetupEmojiDirectory() (err error)
SetupEmojiDirectory sets up the custom emoji directory by copying all built-in emojis if the directory does not yet exist.
func SetupPersistence ¶
SetupPersistence will open the datastore and make it available.
Types ¶
type Datastore ¶ added in v0.0.6
Datastore is the global key/value store for configuration values.
func GetDatastore ¶ added in v0.0.8
func GetDatastore() *Datastore
GetDatastore returns the shared instance of the owncast datastore.
func GetStore ¶ added in v0.0.6
func GetStore() *Datastore
GetStore will return the shared instance of the read/write datastore.
func (*Datastore) Get ¶ added in v0.0.6
func (ds *Datastore) Get(key string) (models.ConfigEntry, error)
Get will query the database for the key and return the entry.
func (*Datastore) GetCachedValue ¶ added in v0.0.6
GetCachedValue will return a value for key from the cache.
func (*Datastore) GetQueries ¶ added in v0.0.11
GetQueries will return the shared instance of the SQL query generator.
func (*Datastore) GetStringMap ¶ added in v0.1.0
GetStringMap will return the string map value for a key.
func (*Datastore) GetStringSlice ¶ added in v0.0.12
GetStringSlice will return the string slice value for a key.
func (*Datastore) MustExec ¶ added in v0.0.13
MustExec will execute a SQL statement on a provided database instance.
func (*Datastore) Reset ¶ added in v0.0.6
func (ds *Datastore) Reset()
Reset will delete all config entries in the datastore and start over.
func (*Datastore) Save ¶ added in v0.0.6
func (ds *Datastore) Save(e models.ConfigEntry) error
Save will save the ConfigEntry to the database.
func (*Datastore) SetCachedValue ¶ added in v0.0.6
SetCachedValue will set a value for key in the cache.
func (*Datastore) SetStringMap ¶ added in v0.1.0
SetStringMap will set the string map value for a key.
func (*Datastore) SetStringSlice ¶ added in v0.0.12
SetStringSlice will set the string slice value for a key.