docs(store): add field usage examples
All checks were successful
Security Scan / security (push) Successful in 10s
Test / test (push) Successful in 1m42s

Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
Virgil 2026-03-30 16:50:04 +00:00
parent a82b0d379b
commit a458464876
2 changed files with 13 additions and 5 deletions

View file

@ -36,10 +36,15 @@ func (t EventType) String() string {
// Usage example: `event := store.Event{Type: store.EventSet, Group: "config", Key: "theme", Value: "dark"}`
// Usage example: `event := store.Event{Type: store.EventDeleteGroup, Group: "config"}`
type Event struct {
Type EventType
Group string
Key string
Value string
// Usage example: `if event.Type == store.EventDeleteGroup { return }`
Type EventType
// Usage example: `if event.Group == "config" { return }`
Group string
// Usage example: `if event.Key == "theme" { return }`
Key string
// Usage example: `if event.Value == "dark" { return }`
Value string
// Usage example: `if event.Timestamp.IsZero() { return }`
Timestamp time.Time
}

View file

@ -169,7 +169,10 @@ func (storeInstance *Store) DeleteGroup(group string) error {
// Usage example: `for entry, err := range storeInstance.All("config") { if err != nil { break }; core.Println(entry.Key, entry.Value) }`
type KeyValue struct {
Key, Value string
// Usage example: `if entry.Key == "theme" { return }`
Key string
// Usage example: `if entry.Value == "dark" { return }`
Value string
}
// Usage example: `configEntries, err := storeInstance.GetAll("config")`