[agent/codex:gpt-5.4-mini] Read docs/RFC-STORE.md fully. Find features described in the... #142
2 changed files with 3 additions and 3 deletions
2
scope.go
2
scope.go
|
|
@ -22,7 +22,7 @@ type QuotaConfig struct {
|
|||
MaxGroups int
|
||||
}
|
||||
|
||||
// Usage example: `scopedStore := store.NewScoped(storeInstance, "tenant-a"); if scopedStore == nil { return }; if err := scopedStore.Set("colour", "blue"); err != nil { return }; if err := scopedStore.SetIn("config", "language", "en-GB"); err != nil { return }`
|
||||
// Usage example: `scopedStore, err := store.NewScopedConfigured(storeInstance, store.ScopedStoreConfig{Namespace: "tenant-a", Quota: store.QuotaConfig{MaxKeys: 100, MaxGroups: 10}}); if err != nil { return }; _ = scopedStore.Set("colour", "blue")`
|
||||
// ScopedStore keeps one namespace isolated behind helpers such as Set and
|
||||
// GetFrom so callers do not repeat the `tenant-a:` prefix manually.
|
||||
type ScopedStore struct {
|
||||
|
|
|
|||
4
store.go
4
store.go
|
|
@ -27,7 +27,7 @@ const (
|
|||
entryValueColumn = "entry_value"
|
||||
)
|
||||
|
||||
// Usage example: `storeOptions := []store.StoreOption{store.WithJournal("http://127.0.0.1:8086", "core", "events")}`
|
||||
// Usage example: `configuredStore, err := store.NewConfigured(store.StoreConfig{DatabasePath: ":memory:", Journal: store.JournalConfiguration{EndpointURL: "http://127.0.0.1:8086", Organisation: "core", BucketName: "events"}})`
|
||||
// Prefer `store.NewConfigured(store.StoreConfig{...})` when the configuration
|
||||
// is already known as a struct literal. Use `StoreOption` only when the values
|
||||
// need to be assembled incrementally.
|
||||
|
|
@ -137,7 +137,7 @@ func (storeInstance *Store) ensureReady(operation string) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// Usage example: `storeInstance, err := store.New("/tmp/go-store.db", store.WithJournal("http://127.0.0.1:8086", "core", "events"))`
|
||||
// Usage example: `storeInstance, err := store.NewConfigured(store.StoreConfig{DatabasePath: "/tmp/go-store.db", Journal: store.JournalConfiguration{EndpointURL: "http://127.0.0.1:8086", Organisation: "core", BucketName: "events"}})`
|
||||
func WithJournal(endpointURL, organisation, bucketName string) StoreOption {
|
||||
return func(storeConfig *StoreConfig) {
|
||||
if storeConfig == nil {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue