nats

package
v0.0.0-...-75a04d1 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2020 License: Apache-2.0 Imports: 7 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	URL     string `envconfig:"URL" default:"nats://localhost:4222"`
	Options []nats.Option
}

func (Config) String

func (c Config) String() string

String returns string representation of Config.

type Option

type Option func(Config) Config

Option provides the means to use function call chaining

func WithTLS

func WithTLS(cfg *tls.Config) Option

WithTLS configures connection to use TLS

type Publisher

type Publisher struct {
	*cqrsNats.Publisher
}

func NewPublisher

func NewPublisher(config Config, opts ...Option) (*Publisher, error)

NewPublisher creates new publisher with proto marshaller.

func (*Publisher) Close

func (p *Publisher) Close()

Close closes the publisher.

type Subscriber

type Subscriber struct {
	*cqrsNats.Subscriber
}

func NewSubscriber

func NewSubscriber(config Config, goroutinePoolGo cqrsEventBus.GoroutinePoolGoFunc, errFunc cqrsEventBus.ErrFunc, opts ...Option) (*Subscriber, error)

NewSubscriber create new subscriber with proto unmarshaller.

func (*Subscriber) Close

func (p *Subscriber) Close()

Close closes the publisher.

Jump to

Keyboard shortcuts

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