generated from dogmatiq/template-go
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change
integration
to use generic journal.Journal
type instead of…
… `protojournal` package.
- Loading branch information
Showing
5 changed files
with
49 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package integration | ||
|
||
import ( | ||
"github.com/dogmatiq/enginekit/protobuf/uuidpb" | ||
"github.com/dogmatiq/persistencekit/journal" | ||
"github.com/dogmatiq/persistencekit/marshal" | ||
"github.com/dogmatiq/veracity/internal/integration/internal/journalpb" | ||
) | ||
|
||
// JournalStore is the [journal.Store] type used to integration handler state. | ||
type JournalStore = journal.Store[*journalpb.Record] | ||
|
||
// Journal is a journal of records for a specific integration handler. | ||
type Journal = journal.Journal[*journalpb.Record] | ||
|
||
// NewJournalStore returns a new [JournalStore] that uses s for its underlying | ||
// storage. | ||
func NewJournalStore(s journal.BinaryStore) JournalStore { | ||
return journal.NewMarshalingStore( | ||
s, | ||
marshal.ProtocolBuffers[*journalpb.Record]{}, | ||
) | ||
} | ||
|
||
// JournalName returns the name of the journal that contains the state | ||
// of the integration handler with the given key. | ||
func JournalName(key *uuidpb.UUID) string { | ||
return "integration:" + key.AsString() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters