go-store/doc.go
Virgil 5df38516cc
All checks were successful
Security Scan / security (push) Successful in 8s
Test / test (push) Successful in 1m26s
refactor(store): tighten AX examples and error handling
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-30 16:41:56 +00:00

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