nats

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrNatsConnection = "nats connection error"
)

Variables

This section is empty.

Functions

func Register

func Register(cfg *config.Config)

Register 注册 NATS 事件发布器

Types

type NatsPublisher

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

NatsPublisher represent event publisher.

func New

func New(conn stan.Conn) *NatsPublisher

New return new NatsPublisher instance.

func (NatsPublisher) Close

func (n NatsPublisher) Close() error

Close NATS connection.

func (NatsPublisher) Publish

func (n NatsPublisher) Publish(subject string, evt *event.Event) error

Publish serializes the event and publishes it on the bus.

Jump to

Keyboard shortcuts

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