natsjsregistry

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2025 License: Apache-2.0 Imports: 14 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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