Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterCompactor(topic string, compactor interface{})
- func WithPoster(ctx context.Context, poster Poster) context.Context
- func WithTopic(ctx context.Context, topic string) context.Context
- func WithTx(pctx context.Context) (ctx context.Context, commit func(), rollback func(err error))
- type Emitter
- type Event
- type Poster
Constants ¶
View Source
const (
EventVersion = "v1"
)
Variables ¶
View Source
var (
G = GetPoster
)
Functions ¶
func RegisterCompactor ¶
func RegisterCompactor(topic string, compactor interface{})
RegisterCompactor sets the compacter for the given topic.
func WithTopic ¶
WithTopic returns a context with a new topic set, such that events emitted from the resulting context will be marked with the topic.
A topic groups events by the target module they operate on. This is primarily designed to support multi-module log compaction of events. In typical journaling systems, the entries operate on a single data structure. When compacting the journal, we can replace all former log entries with a summary data structure that will result in the same state.
By providing a compaction mechanism by topic, we can prune down to a data structure oriented towards a single topic, leaving unrelated messages alone.
Types ¶
Click to show internal directories.
Click to hide internal directories.