docs(ax): tighten usage examples
Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
parent
e1341ff2d5
commit
69452ef43f
2 changed files with 4 additions and 5 deletions
1
scope.go
1
scope.go
|
|
@ -61,6 +61,7 @@ func (scopedConfig ScopedStoreConfig) Validate() error {
|
|||
}
|
||||
|
||||
// ScopedStore prefixes group names with namespace + ":" before delegating to Store.
|
||||
// Usage example: `scopedStore, err := store.NewScoped(storeInstance, "tenant-a"); if err != nil { return }; if err := scopedStore.Set("colour", "blue"); err != nil { return }`
|
||||
//
|
||||
// Usage example: `scopedStore, err := store.NewScoped(storeInstance, "tenant-a"); if err != nil { return }; if err := scopedStore.SetIn("config", "colour", "blue"); err != nil { return }`
|
||||
type ScopedStore struct {
|
||||
|
|
|
|||
8
store.go
8
store.go
|
|
@ -80,12 +80,10 @@ func (storeConfig StoreConfig) Validate() error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// Usage example: `config := store.JournalConfiguration{EndpointURL: "http://127.0.0.1:8086", Organisation: "core", BucketName: "events"}`
|
||||
// JournalConfiguration keeps the journal connection details in one literal so
|
||||
// agents can pass a single struct to `StoreConfig.Journal` or `WithJournal`.
|
||||
// Usage example: `config := storeInstance.JournalConfiguration(); fmt.Println(config.EndpointURL, config.Organisation, config.BucketName)`
|
||||
// JournalConfiguration stores the SQLite journal metadata used by
|
||||
// CommitToJournal and QueryJournal. The field names stay aligned with the
|
||||
// agent-facing RFC vocabulary even though the implementation is local to this
|
||||
// package.
|
||||
// Usage example: `store.NewConfigured(store.StoreConfig{DatabasePath: ":memory:", Journal: store.JournalConfiguration{EndpointURL: "http://127.0.0.1:8086", Organisation: "core", BucketName: "events"}})`
|
||||
type JournalConfiguration struct {
|
||||
// Usage example: `config := store.JournalConfiguration{EndpointURL: "http://127.0.0.1:8086"}`
|
||||
EndpointURL string
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue