docs(ax): prefer declarative config literals in examples
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run

Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
Virgil 2026-04-04 19:45:52 +00:00
parent 8b186449f9
commit 257bd520f6
3 changed files with 7 additions and 3 deletions

View file

@ -32,6 +32,7 @@ func main() {
BucketName: "events",
},
PurgeInterval: 30 * time.Second,
WorkspaceStateDirectory: "/tmp/core-state",
})
if err != nil {
return

8
doc.go
View file

@ -16,9 +16,10 @@
// already available, because it reads as data rather than a sequence of
// steps. Use `StoreConfig.Normalised()` when you want the default purge
// interval and workspace state directory filled in before you pass the config
// onward. Use `store.WithWorkspaceStateDirectory("/tmp/core-state")` only
// when the workspace path is assembled incrementally rather than declared up
// front.
// onward. Include `WorkspaceStateDirectory: "/tmp/core-state"` in the struct
// literal when the path is known; use `store.WithWorkspaceStateDirectory`
// only when the workspace path is assembled incrementally rather than
// declared up front.
//
// Usage example:
//
@ -31,6 +32,7 @@
// BucketName: "events",
// },
// PurgeInterval: 20 * time.Millisecond,
// WorkspaceStateDirectory: "/tmp/core-state",
// })
// if err != nil {
// return

View file

@ -32,6 +32,7 @@ func main() {
storeInstance, err := store.NewConfigured(store.StoreConfig{
DatabasePath: "/tmp/app.db",
PurgeInterval: 30 * time.Second,
WorkspaceStateDirectory: "/tmp/core-state",
})
if err != nil {
return