docs(store): clarify AX examples for options

Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
Virgil 2026-04-04 13:25:19 +00:00
parent 168c94d525
commit 019a72d152
2 changed files with 6 additions and 3 deletions

View file

@ -15,6 +15,8 @@ var defaultArchiveOutputDirectory = ".core/archive/"
// compressed JSONL file.
//
// Usage example: `options := store.CompactOptions{Before: time.Now().Add(-90 * 24 * time.Hour), Output: "/tmp/archive", Format: "gzip"}`
// The default output directory is `.core/archive/`; the default format is
// `gzip`, and `zstd` is also supported.
type CompactOptions struct {
// Usage example: `options := store.CompactOptions{Before: time.Now().Add(-90 * 24 * time.Hour)}`
Before time.Time

View file

@ -27,10 +27,11 @@ const (
entryValueColumn = "entry_value"
)
// Usage example: `configuredStore, err := store.NewConfigured(store.StoreConfig{DatabasePath: ":memory:", Journal: store.JournalConfiguration{EndpointURL: "http://127.0.0.1:8086", Organisation: "core", BucketName: "events"}})`
// Usage example: `storeInstance, err := store.New("/tmp/go-store.db", store.WithJournal("http://127.0.0.1:8086", "core", "events"), store.WithPurgeInterval(30*time.Second))`
// Prefer `store.NewConfigured(store.StoreConfig{...})` when the configuration
// is already known as a struct literal. Use `StoreOption` only when the values
// need to be assembled incrementally.
// 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
// different sources.
type StoreOption func(*StoreConfig)
// Usage example: `config := store.StoreConfig{DatabasePath: ":memory:", PurgeInterval: 30 * time.Second}`