nats

package
v0.0.0-...-d1c628d Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Nats

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

Nats provides nats publish and subscribe

func NewNats

func NewNats(clusterName string, opts ...stan.Option) (*Nats, error)

NewNats creates a new Nats connection for a project

func (*Nats) Publish

func (n *Nats) Publish(ctx context.Context, topic string, m *pubsub.Msg) error

Publish implements Publish

func (*Nats) Shutdown

func (n *Nats) Shutdown()

Shutdown shuts down all subscribers gracefully

func (*Nats) Subscribe

func (n *Nats) Subscribe(opts pubsub.HandlerOptions, h pubsub.MsgHandler)

Subscribe implements Subscribe for Nats

Jump to

Keyboard shortcuts

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