event

package
v0.0.0-...-ccf9113 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close()

func PublishBookCreated

func PublishBookCreated(book schema.Book) error

func SetEventStore

func SetEventStore(es EventStore)

Types

type BookCreatedMessage

type BookCreatedMessage struct {
	ID        string
	Name      string
	CreatedAt time.Time
}

func (*BookCreatedMessage) Key

func (m *BookCreatedMessage) Key() string

type EventStore

type EventStore interface {
	Close()
	PublishBookCreated(moew schema.Book) error
}

type Message

type Message interface {
	Key() string
}

type NatsEventStore

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

func NewNats

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

func (*NatsEventStore) Close

func (n *NatsEventStore) Close()

func (*NatsEventStore) PublishBookCreated

func (n *NatsEventStore) PublishBookCreated(book schema.Book) error

Jump to

Keyboard shortcuts

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