Documentation ¶
Index ¶
- Variables
- func SetEventStoreDB(psqlInfo string)
- type Dispatcher
- type Event
- type EventStore
- func (eventstore *EventStore) Broadcast() error
- func (eventstore *EventStore) GetEvent() any
- func (eventstore *EventStore) Publish(event Event)
- func (eventstore *EventStore) Query(projection string) map[string](map[string]any)
- func (eventstore *EventStore) Run()
- func (eventstore *EventStore) Setup(dbname string)
- type EventStoreListener
- type EventStoreNode
- type Serializer
Constants ¶
This section is empty.
Variables ¶
View Source
var EventStoreDB *sql.DB
Functions ¶
Types ¶
type EventStore ¶
type EventStore struct { Dispatcher *Dispatcher Done chan bool Wg sync.WaitGroup // contains filtered or unexported fields }
func (*EventStore) Broadcast ¶
func (eventstore *EventStore) Broadcast() error
Broadcasts every published event
func (*EventStore) Query ¶
func (eventstore *EventStore) Query(projection string) map[string](map[string]any)
querying database for events of projections'
func (*EventStore) Run ¶
func (eventstore *EventStore) Run()
func (*EventStore) Setup ¶
func (eventstore *EventStore) Setup(dbname string)
Setting up database and creating table
type EventStoreListener ¶
type EventStoreNode ¶
type EventStoreNode struct { Listner EventStoreListener DC webrtc.DataChannel // contains filtered or unexported fields }
func NewEventStoreNode ¶
func NewEventStoreNode(dispatcher Dispatcher) *EventStoreNode
EventStoreNode constructor
func (*EventStoreNode) HandleDataChannel ¶
func (eventstore *EventStoreNode) HandleDataChannel(id string, event *Event)
func (*EventStoreNode) Publish ¶
func (eventstore *EventStoreNode) Publish(event string)
Sending bytes over datachannels to publish events and send it in database Serializing data before inserting it to database
func (*EventStoreNode) Subscribe ¶
func (eventstore *EventStoreNode) Subscribe(event Event)
Usecase of datachannel, event is encoded into bytes and send to another peer (look into Publish func)
type Serializer ¶
type Serializer struct {
// contains filtered or unexported fields
}
func (*Serializer) Deserialize ¶
func (serializer *Serializer) Deserialize(data []byte) map[string]any
Deserialize deserializes data []byte to map[string]any
Click to show internal directories.
Click to hide internal directories.