event

package
v0.0.0-...-40fc3ee Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 19, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close()

Close ...

func OnReactionCreated

func OnReactionCreated(f func(ReactionCreatedMessage)) error

OnReactionCreated ...

func PublishReactionCreated

func PublishReactionCreated(reaction domain.Reaction) error

PublishReactionCreated ...

func SetReactionEventStore

func SetReactionEventStore(es ReactionEventStore)

SetReactionEventStore ...

func SubscribeReactionCreated

func SubscribeReactionCreated() (<-chan ReactionCreatedMessage, error)

SubscribeReactionCreated ...

Types

type Message

type Message interface {
	Key() string
}

Message ...

type NatsEventStore

type NatsEventStore struct {
	// contains filtered or unexported fields
}

NatsEventStore ...

func NewNats

func NewNats(url string) (*NatsEventStore, error)

NewNats ...

func (*NatsEventStore) Close

func (e *NatsEventStore) Close()

Close ...

func (*NatsEventStore) OnReactionCreated

func (e *NatsEventStore) OnReactionCreated(f func(ReactionCreatedMessage)) (err error)

OnReactionCreated ...

func (*NatsEventStore) PublishReactionCreated

func (e *NatsEventStore) PublishReactionCreated(reaction domain.Reaction) error

PublishReactionCreated ...

func (*NatsEventStore) SubscribeReactionCreated

func (e *NatsEventStore) SubscribeReactionCreated() (<-chan ReactionCreatedMessage, error)

SubscribeReactionCreated ...

type ReactionCreatedMessage

type ReactionCreatedMessage struct {
	ID          string
	PersonID    string
	Details     string
	Description string
	Type        string
	Date        time.Time
}

ReactionCreatedMessage is a reaction structures

func (*ReactionCreatedMessage) Key

func (m *ReactionCreatedMessage) Key() string

Key ...

type ReactionEventStore

type ReactionEventStore interface {
	Close()
	PublishReactionCreated(reaction domain.Reaction) error
	SubscribeReactionCreated() (<-chan ReactionCreatedMessage, error)
	OnReactionCreated(f func(ReactionCreatedMessage)) error
}

ReactionEventStore ...

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL