cytonats

package
v0.0.0-...-590dedb Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2019 License: MIT Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NatsClient

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

NatsClient is the state of the client

func NewNatsClient

func NewNatsClient(endpoint string) (*NatsClient, error)

NewNatsClient creates a new NATS client and attempts to connect to the specified endpoint

func (*NatsClient) ChanQueueSubscribe

func (c *NatsClient) ChanQueueSubscribe(subject string, queue string) (<-chan *nats.Msg, error)

ChanQueueSubscribe to a nats subject and queue group with a channel

func (*NatsClient) ChanSubscribe

func (c *NatsClient) ChanSubscribe(subject string) (<-chan *nats.Msg, error)

ChanSubscribe to a nats subject with a channel

func (*NatsClient) Publish

func (c *NatsClient) Publish(subject string, msg interface{}) error

Publish sends a message to subject subscriptions

func (*NatsClient) QueueSubscribe

func (c *NatsClient) QueueSubscribe(subject string, queue string, callback func(msg *nats.Msg)) error

QueueSubscribe to a nats subject and queue group with a callback

func (*NatsClient) Request

func (c *NatsClient) Request(subject string, msg interface{}) (*nats.Msg, error)

Request sends a message to subject subscriptions

func (*NatsClient) Shutdown

func (c *NatsClient) Shutdown()

Shutdown gracefull cleans up subscriptions and the client

func (*NatsClient) Subscribe

func (c *NatsClient) Subscribe(subject string, callback func(msg *nats.Msg)) error

Subscribe to a nats subject with a callback

func (*NatsClient) Unsubscribe

func (c *NatsClient) Unsubscribe(subject string) error

Unsubscribe drains a subscription

Jump to

Keyboard shortcuts

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