[agent/codex:gpt-5.4-mini] Read docs/RFC-STORE.md and docs/specs/core/go/RFC.md fully. ... #160
3 changed files with 12 additions and 7 deletions
9
doc.go
9
doc.go
|
|
@ -11,10 +11,11 @@
|
|||
// `RecoverOrphans(".core/state/")`.
|
||||
//
|
||||
// Use `store.NewConfigured(store.StoreConfig{...})` when the database path,
|
||||
// journal, and purge interval are already known. Prefer the struct literal
|
||||
// over `store.New(..., store.WithJournal(...))` when the full configuration is
|
||||
// already available, because it reads as data rather than a chain of steps.
|
||||
// Use `store.WithWorkspaceStateDirectory("/tmp/core-state")` when the
|
||||
// journal, purge interval, or workspace state directory are already known.
|
||||
// Prefer the struct literal over `store.New(..., store.WithJournal(...))`
|
||||
// when the full configuration is already available, because it reads as data
|
||||
// rather than a chain of steps. Use
|
||||
// `store.WithWorkspaceStateDirectory("/tmp/core-state")` only when the
|
||||
// workspace path is assembled incrementally rather than declared up front.
|
||||
//
|
||||
// Usage example:
|
||||
|
|
|
|||
4
store.go
4
store.go
|
|
@ -174,6 +174,8 @@ func WithJournal(endpointURL, organisation, bucketName string) StoreOption {
|
|||
}
|
||||
|
||||
// Usage example: `storeInstance, err := store.NewConfigured(store.StoreConfig{DatabasePath: ":memory:", WorkspaceStateDirectory: "/tmp/core-state"})`
|
||||
// Use this when the workspace state directory is being assembled
|
||||
// incrementally; otherwise prefer a StoreConfig literal.
|
||||
func WithWorkspaceStateDirectory(directory string) StoreOption {
|
||||
return func(storeConfig *StoreConfig) {
|
||||
if storeConfig == nil {
|
||||
|
|
@ -241,6 +243,8 @@ func (storeInstance *Store) IsClosed() bool {
|
|||
}
|
||||
|
||||
// Usage example: `storeInstance, err := store.NewConfigured(store.StoreConfig{DatabasePath: ":memory:", PurgeInterval: 20 * time.Millisecond})`
|
||||
// Use this when the purge interval is being assembled incrementally; otherwise
|
||||
// prefer a StoreConfig literal.
|
||||
func WithPurgeInterval(interval time.Duration) StoreOption {
|
||||
return func(storeConfig *StoreConfig) {
|
||||
if storeConfig == nil {
|
||||
|
|
|
|||
|
|
@ -113,9 +113,9 @@ func (storeInstance *Store) NewWorkspace(name string) (*Workspace, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
validation := core.ValidateName(name)
|
||||
if !validation.OK {
|
||||
return nil, core.E("store.NewWorkspace", "validate workspace name", validation.Value.(error))
|
||||
workspaceNameValidation := core.ValidateName(name)
|
||||
if !workspaceNameValidation.OK {
|
||||
return nil, core.E("store.NewWorkspace", "validate workspace name", workspaceNameValidation.Value.(error))
|
||||
}
|
||||
|
||||
filesystem := (&core.Fs{}).NewUnrestricted()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue