nats

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2020 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigNats

type ConfigNats struct {
	Conn []Item `yaml:"nats"`
}

type Item

type Item struct {
	Host string `yaml:"host"`
	Port int    `yaml:"port"`
}

type Nats

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

func New

func New(cfg *ConfigNats) *Nats

func (*Nats) Down

func (db *Nats) Down() error

func (*Nats) PubSub

func (db *Nats) PubSub(subject, queue string, cb func([]byte) ([]byte, error)) error

func (*Nats) Publish

func (db *Nats) Publish(subject string, v interface{}) error

func (*Nats) Request

func (db *Nats) Request(subject string, in, out interface{}, timeout time.Duration) error

func (*Nats) Subscribe

func (db *Nats) Subscribe(subject, queue string, cb interface{}) error

func (*Nats) SubscribeWithContext

func (db *Nats) SubscribeWithContext(ctx context.Context, subject, queue string, cb interface{}) error

func (*Nats) Up

func (db *Nats) Up() error

Jump to

Keyboard shortcuts

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