natsjsregistry

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package natsjsregistry implements a registry using natsjs kv store

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultTTL

func DefaultTTL(t time.Duration) registry.Option

DefaultTTL allows setting a default register TTL for services

func NewRegistry

func NewRegistry(opts ...registry.Option) registry.Registry

NewRegistry returns a new natsjs registry

func StoreOptions

func StoreOptions(opts []store.Option) registry.Option

StoreOptions sets the options for the underlying store

Types

type NatsWatcher

type NatsWatcher interface {
	WatchAll(bucket string, opts ...nats.WatchOpt) (<-chan *natsjskv.StoreUpdate, func() error, error)
}

NatsWatcher is the watcher of the nats interface

type Watcher

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

Watcher is used to keep track of changes in the registry

func NewWatcher

func NewWatcher(s *storeregistry) (*Watcher, error)

NewWatcher returns a new watcher

func (*Watcher) Next

func (w *Watcher) Next() (*registry.Result, error)

Next returns the next result. It is a blocking call

func (*Watcher) Stop

func (w *Watcher) Stop()

Stop stops the watcher

Jump to

Keyboard shortcuts

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