disconats

package module
v0.0.0-...-6de2257 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2023 License: BSD-3-Clause Imports: 10 Imported by: 1

Documentation

Overview

Package disconats contains Rafty Discoverers which leverage the use NATS.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KVDiscoverer

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

KVDiscoverer is a Rafty discoverer which leverages the use of NATS JetStream key values. This discoverer will register itself upon calling Start() and deregister itself when terminated.

func NewKVDiscoverer

func NewKVDiscoverer(advertisedAddr string, natsConn *nats.Conn, options ...KVOption) (*KVDiscoverer, error)

func (*KVDiscoverer) Done

func (d *KVDiscoverer) Done() chan struct{}

func (*KVDiscoverer) GetServers

func (d *KVDiscoverer) GetServers() []raft.Server

func (*KVDiscoverer) NewServers

func (d *KVDiscoverer) NewServers() chan struct{}

func (*KVDiscoverer) Start

func (d *KVDiscoverer) Start(ctx context.Context)

type KVOption

type KVOption func(*KVDiscoverer) error

func JSBucket

func JSBucket(bucket string) KVOption

func JSContext

func JSContext(ctx nats.JetStreamContext) KVOption

func Logger

func Logger(logger interfaces.Logger) KVOption

Jump to

Keyboard shortcuts

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