go-plugins: github.com/micro/go-plugins/registry/nats Index | Files

package nats

import "github.com/micro/go-plugins/registry/nats"

Package nats provides a NATS registry using broadcast queries


Package Files

nats.go options.go util.go watcher.go


var (
    DefaultQuorum = 0

func NewRegistry Uses

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

func Options Uses

func Options(nopts nats.Options) registry.Option

Options allow to inject a nats.Options struct for configuring the nats connection

func QueryTopic Uses

func QueryTopic(s string) registry.Option

QueryTopic allows to set a custom nats topic on which service registries query (survey) other services. All registries listen on this topic and then respond to the query message.

func Quorum Uses

func Quorum(n int) registry.Option

func WatchTopic Uses

func WatchTopic(s string) registry.Option

WatchTopic allows to set a custom nats topic on which registries broadcast changes (e.g. when services are added, updated or removed). Since we don't have a central registry service, each service typically broadcasts in a determined frequency on this topic.

Package nats imports 8 packages (graph) and is imported by 10 packages. Updated 2019-06-24. Refresh now. Tools for package owners.