From f4492b18617a575e029a52ee01fcda85b96acd1d Mon Sep 17 00:00:00 2001 From: Virgil Date: Fri, 3 Apr 2026 06:08:16 +0000 Subject: [PATCH] feat(store): surface journal configuration on store Co-Authored-By: Virgil --- journal.go | 3 +++ store.go | 4 ++++ store_test.go | 2 ++ 3 files changed, 9 insertions(+) diff --git a/journal.go b/journal.go index 8f471f7..082a08f 100644 --- a/journal.go +++ b/journal.go @@ -163,6 +163,9 @@ func (storeInstance *Store) queryJournalFlux(flux string) (string, []any, error) } func (storeInstance *Store) journalBucket() string { + if storeInstance.bucket != "" { + return storeInstance.bucket + } if storeInstance.journal.bucketName == "" { return defaultJournalBucket } diff --git a/store.go b/store.go index a762176..7532251 100644 --- a/store.go +++ b/store.go @@ -45,6 +45,8 @@ type Store struct { purgeWaitGroup sync.WaitGroup purgeInterval time.Duration // interval between background purge cycles journal journalDestinationConfig + bucket string + org string closeLock sync.Mutex closed bool @@ -64,6 +66,8 @@ func WithJournal(endpointURL, organisation, bucketName string) StoreOption { organisation: organisation, bucketName: bucketName, } + storeInstance.bucket = bucketName + storeInstance.org = organisation } } diff --git a/store_test.go b/store_test.go index 6262073..1963e3d 100644 --- a/store_test.go +++ b/store_test.go @@ -106,6 +106,8 @@ func TestStore_New_Good_WithJournalOption(t *testing.T) { assert.Equal(t, "events", storeInstance.journal.bucketName) assert.Equal(t, "core", storeInstance.journal.organisation) assert.Equal(t, "http://127.0.0.1:8086", storeInstance.journal.endpointURL) + assert.Equal(t, "events", storeInstance.bucket) + assert.Equal(t, "core", storeInstance.org) } // ---------------------------------------------------------------------------