Merge pull request '[agent/codex:gpt-5.4-mini] Read docs/RFC-STORE.md and docs/specs/core/go/RFC.md fully. ...' (#166) from agent/read-docs-rfc-store-md-and-docs-specs-co into dev
This commit is contained in:
commit
af98f960bb
2 changed files with 7 additions and 9 deletions
9
scope.go
9
scope.go
|
|
@ -102,15 +102,6 @@ func NewScopedConfigured(storeInstance *Store, scopedConfig ScopedStoreConfig) (
|
|||
return scopedStore, nil
|
||||
}
|
||||
|
||||
// NewScopedWithQuota adds per-namespace key and group limits.
|
||||
// Usage example: `scopedStore, err := store.NewScopedWithQuota(storeInstance, "tenant-a", store.QuotaConfig{MaxKeys: 100, MaxGroups: 10}); if err != nil { return }`
|
||||
func NewScopedWithQuota(storeInstance *Store, namespace string, quota QuotaConfig) (*ScopedStore, error) {
|
||||
return NewScopedConfigured(storeInstance, ScopedStoreConfig{
|
||||
Namespace: namespace,
|
||||
Quota: quota,
|
||||
})
|
||||
}
|
||||
|
||||
func (scopedStore *ScopedStore) namespacedGroup(group string) string {
|
||||
return scopedStore.namespace + ":" + group
|
||||
}
|
||||
|
|
|
|||
|
|
@ -78,3 +78,10 @@ func requireResultRows(tb testing.TB, result core.Result) []map[string]any {
|
|||
require.True(tb, ok, "unexpected row type: %T", result.Value)
|
||||
return rows
|
||||
}
|
||||
|
||||
func NewScopedWithQuota(storeInstance *Store, namespace string, quota QuotaConfig) (*ScopedStore, error) {
|
||||
return NewScopedConfigured(storeInstance, ScopedStoreConfig{
|
||||
Namespace: namespace,
|
||||
Quota: quota,
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue