diff --git a/scope.go b/scope.go index 754ad17..cd0c877 100644 --- a/scope.go +++ b/scope.go @@ -61,6 +61,7 @@ func (scopedConfig ScopedStoreConfig) Validate() error { } // ScopedStore prefixes group names with namespace + ":" before delegating to Store. +// Usage example: `scopedStore, err := store.NewScoped(storeInstance, "tenant-a"); if err != nil { return }; if err := scopedStore.Set("colour", "blue"); err != nil { return }` // // Usage example: `scopedStore, err := store.NewScoped(storeInstance, "tenant-a"); if err != nil { return }; if err := scopedStore.SetIn("config", "colour", "blue"); err != nil { return }` type ScopedStore struct { diff --git a/store.go b/store.go index 9f13de3..8781821 100644 --- a/store.go +++ b/store.go @@ -80,12 +80,10 @@ func (storeConfig StoreConfig) Validate() error { return nil } +// Usage example: `config := store.JournalConfiguration{EndpointURL: "http://127.0.0.1:8086", Organisation: "core", BucketName: "events"}` +// JournalConfiguration keeps the journal connection details in one literal so +// agents can pass a single struct to `StoreConfig.Journal` or `WithJournal`. // Usage example: `config := storeInstance.JournalConfiguration(); fmt.Println(config.EndpointURL, config.Organisation, config.BucketName)` -// JournalConfiguration stores the SQLite journal metadata used by -// CommitToJournal and QueryJournal. The field names stay aligned with the -// agent-facing RFC vocabulary even though the implementation is local to this -// package. -// Usage example: `store.NewConfigured(store.StoreConfig{DatabasePath: ":memory:", Journal: store.JournalConfiguration{EndpointURL: "http://127.0.0.1:8086", Organisation: "core", BucketName: "events"}})` type JournalConfiguration struct { // Usage example: `config := store.JournalConfiguration{EndpointURL: "http://127.0.0.1:8086"}` EndpointURL string