nats

package
v0.0.0-...-0871eb3 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connection

func Connection(host, user, pass string, port int) (*nats.Conn, error)

Connection is to connect NATS server

func Publish

func Publish(host, user, pass, subject, msg string, port int) error

Publish is not used because of just example.

func Unsubscribe

func Unsubscribe(sub *nats.Subscription)

Unsubscribe is to unsubscribe to subject

Types

type ChReceive

type ChReceive struct {
	Conn   *nats.Conn
	ChWait chan bool
	ChCMsg chan *nats.Msg
	Error  error
}

ChReceive is struct of channel for receiver

func (ChReceive) Subscribe

func (ch ChReceive) Subscribe(subject string)

Subscribe is to subscribe to subject

Jump to

Keyboard shortcuts

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