client

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NatsSetupConnOptions

func NatsSetupConnOptions(name string) []natsGo.Option

natsSetupConnOptions setup the Nats connection option such as reconnect

func New

func New(conf Conf) nats

Types

type Conf

type Conf struct {
	Host string
	Port string
}

type Nats

type Nats interface {
	Connect(opts []natsGo.Option) error
	Disconnect()
	Subscribe(subject string, handler natsGo.MsgHandler) (*natsGo.Subscription, error)
	CreatePublisher() NatsPubType
	Publish(subject string, payload string) error
}

type NatsPubType

type NatsPubType func(thingId string, payload string) error

Jump to

Keyboard shortcuts

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