event

package
v0.0.0-...-fc8bcac Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2019 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IEvent

type IEvent interface {
	Store(
		domain, model, eventType, subject, eventSource string,
		f endpoint.Endpoint,
		metaBuilder MetaBuilder,
	) endpoint.Endpoint
	Subscribe() *stan.Subscription
}

IEvent ...

type MetaBuilder

type MetaBuilder func(data interface{}) interface{}

MetaBuilder wraping and building meta data before send it to nats

type Publisher

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

Publisher wraps a URL and provides a method that implements endpoint.Endpoint.

func NewPublisher

func NewPublisher(conn stan.Conn, logger log.Logger) *Publisher

NewPublisher to create new Publisher

func (*Publisher) Store

func (p *Publisher) Store(domain, model, eventType, subject, eventSource string, f endpoint.Endpoint, metabuilder MetaBuilder) endpoint.Endpoint

Store for publish event (begin and commit) to nats and data wrapping as a middleware

type Subscriber

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

Subscriber wraps subscription to topic a URL and provides a method that implements endpoint.Endpoint.

func NewSubscriber

func NewSubscriber(conn stan.Conn, subject string, group string, durable string, startAt string, logger log.Logger, handler stan.MsgHandler) *Subscriber

NewSubscriber to create new Subscriber

func (*Subscriber) Subscribe

func (s *Subscriber) Subscribe() *stan.Subscription

Subscribe to subscribe topic to nats

Jump to

Keyboard shortcuts

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