nats

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// nats endpoint (comma separated urls are possible, eg "nats://one, nats://two").
	URL string

	// Optional NATS options: nats.Connect(url, ...options)
	Options []nats.Option

	// Optional JetStream options: nc.JetStream(...options)
	JetStreamOptions []nats.JSOpt

	// Bucket is the Nats KV bucket.
	Bucket string

	// Prefix (optional).
	Prefix string
}

type Nats

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

Nats implements the nats config provider.

func Provider

func Provider(cfg Config) (*Nats, error)

Provider returns a provider that takes nats config.

func (*Nats) Read

func (n *Nats) Read() (map[string]interface{}, error)

Read returns a nested config map.

func (*Nats) ReadBytes

func (n *Nats) ReadBytes() ([]byte, error)

ReadBytes is not supported by nats provider.

func (*Nats) Watch

func (n *Nats) Watch(cb func(event interface{}, err error)) error

Jump to

Keyboard shortcuts

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