diff --git a/events.go b/events.go index 84bef9f..5893706 100644 --- a/events.go +++ b/events.go @@ -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 } diff --git a/store.go b/store.go index be5b91e..6449ee9 100644 --- a/store.go +++ b/store.go @@ -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")`