Merge pull request '[agent/codex:gpt-5.4-mini] Read docs/RFC-STORE.md and docs/specs/core/go/RFC.md fully. ...' (#176) from agent/read-docs-rfc-store-md-and-docs-specs-co into dev
This commit is contained in:
commit
cf58c72ac5
3 changed files with 8 additions and 4 deletions
4
doc.go
4
doc.go
|
|
@ -2,7 +2,9 @@
|
|||
// namespace isolation, quota enforcement, reactive events, journal writes,
|
||||
// workspace buffering, cold archive compaction, and orphan recovery.
|
||||
//
|
||||
// Prefer struct literals when the configuration is already known:
|
||||
// Prefer `store.NewConfigured(store.StoreConfig{...})` and
|
||||
// `store.NewScopedConfigured(store.ScopedStoreConfig{...})` when the
|
||||
// configuration is already known:
|
||||
//
|
||||
// configuredStore, err := store.NewConfigured(store.StoreConfig{
|
||||
// DatabasePath: ":memory:",
|
||||
|
|
|
|||
2
scope.go
2
scope.go
|
|
@ -83,6 +83,8 @@ type scopedWatcherBridge struct {
|
|||
|
||||
// NewScoped validates a namespace and prefixes groups with namespace + ":".
|
||||
// Usage example: `scopedStore, err := store.NewScoped(storeInstance, "tenant-a"); if err != nil { return }`
|
||||
// Prefer `NewScopedConfigured` when the namespace and quota are already known
|
||||
// as a struct literal.
|
||||
func NewScoped(storeInstance *Store, namespace string) (*ScopedStore, error) {
|
||||
if storeInstance == nil {
|
||||
return nil, core.E("store.NewScoped", "store instance is nil", nil)
|
||||
|
|
|
|||
6
store.go
6
store.go
|
|
@ -29,9 +29,9 @@ const (
|
|||
)
|
||||
|
||||
// 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"}, PurgeInterval: 30 * time.Second})`
|
||||
// Prefer `store.NewConfigured(store.StoreConfig{...})` when the configuration
|
||||
// is already known as a struct literal. Use `StoreOption` only when values
|
||||
// need to be assembled incrementally, such as when a caller receives them from
|
||||
// Prefer `store.NewConfigured(store.StoreConfig{...})` when the full
|
||||
// configuration is already known. Use `StoreOption` only when values need to
|
||||
// be assembled incrementally, such as when a caller receives them from
|
||||
// different sources.
|
||||
type StoreOption func(*StoreConfig)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue