Update events.go

This commit is contained in:
Asim Aslam 2020-08-22 09:20:53 +01:00 committed by GitHub
parent 6cda6ef92e
commit e80eab397a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,4 @@
// Package events contains interfaces for managing events within distributed systems // Package events is for event streaming and storage
package events package events
import ( import (
@ -14,13 +14,13 @@ var (
ErrEncodingMessage = errors.New("Error encoding message") ErrEncodingMessage = errors.New("Error encoding message")
) )
// Stream of events // Stream is an event streaming interface
type Stream interface { type Stream interface {
Publish(topic string, msg interface{}, opts ...PublishOption) error Publish(topic string, msg interface{}, opts ...PublishOption) error
Subscribe(topic string, opts ...SubscribeOption) (<-chan Event, error) Subscribe(topic string, opts ...SubscribeOption) (<-chan Event, error)
} }
// Store of events // Store is an event store interface
type Store interface { type Store interface {
Read(topic string, opts ...ReadOption) ([]*Event, error) Read(topic string, opts ...ReadOption) ([]*Event, error)
Write(event *Event, opts ...WriteOption) error Write(event *Event, opts ...WriteOption) error