38 lines
1,001 B
Go
38 lines
1,001 B
Go
// Package store provides SQLite-backed storage for grouped entries, TTL expiry,
|
|
// namespace isolation, and reactive change notifications.
|
|
//
|
|
// Usage example:
|
|
//
|
|
// func main() {
|
|
// storeInstance, err := store.New(":memory:")
|
|
// if err != nil {
|
|
// return
|
|
// }
|
|
// defer storeInstance.Close()
|
|
//
|
|
// if err := storeInstance.Set("config", "theme", "dark"); err != nil {
|
|
// return
|
|
// }
|
|
// themeValue, err := storeInstance.Get("config", "theme")
|
|
// if err != nil {
|
|
// return
|
|
// }
|
|
// core.Println(themeValue)
|
|
//
|
|
// scopedStore, err := store.NewScoped(storeInstance, "tenant-a")
|
|
// if err != nil {
|
|
// return
|
|
// }
|
|
// if err := scopedStore.Set("config", "theme", "dark"); err != nil {
|
|
// return
|
|
// }
|
|
//
|
|
// quotaScopedStore, err := store.NewScopedWithQuota(storeInstance, "tenant-b", store.QuotaConfig{MaxKeys: 100, MaxGroups: 10})
|
|
// if err != nil {
|
|
// return
|
|
// }
|
|
// if err := quotaScopedStore.Set("prefs", "locale", "en-GB"); err != nil {
|
|
// return
|
|
// }
|
|
// }
|
|
package store
|