heartbeat

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2020 License: MIT Imports: 4 Imported by: 2

README

heartbeat

A simple NATS Heartbeat lib

Documentation

Index

Constants

View Source
const (
	PublisherTopic        = "peer-heartbeat"
	ConsumerRegisterTopic = "peer-consumer-register"
	TickerTime            = 30 * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

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

func NewHandler

func NewHandler(id string, nc *nats.Conn, hos ...Option) *Handler

func (*Handler) GetConsumers

func (h *Handler) GetConsumers() []string

func (*Handler) ListenForConsumers

func (h *Handler) ListenForConsumers()

func (*Handler) ListenForHeartbeatPublisher

func (h *Handler) ListenForHeartbeatPublisher()

func (*Handler) StartHeartbeatPublisher

func (h *Handler) StartHeartbeatPublisher()

type Option

type Option func(h *Handler)

func SetConsumerRegisterTopic

func SetConsumerRegisterTopic(topic string) Option

func SetHeartbeatTickerTime

func SetHeartbeatTickerTime(ti time.Duration) Option

func SetHeartbeatTopic

func SetHeartbeatTopic(topic string) Option

func SetLogger

func SetLogger(l logrus.FieldLogger) Option

Jump to

Keyboard shortcuts

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