jetstream

package module
v0.0.0-...-0b0f5e7 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2022 License: MIT Imports: 4 Imported by: 0

README

Jetstream NATS Module for Helium

Build Status Report GitHub release GitHub

Module provides you with the following things:

  • *nats.Conn represents a bare connection to a nats-server. It can send and receive []byte payloads
  • nats.JetStreamContext represents a streaming context. It can Publish and Subscribe to messages within the NATS JetStream cluster.

Documentation

Index

Constants

View Source
const (

	// ErrEmptyConfig when given empty options
	ErrEmptyConfig = Error("nats empty config")
)

Variables

View Source
var (
	// Module is default Nats client
	Module = module.Module{
		{Constructor: NewDefaultConfig},
		{Constructor: NewConnection},
		{Constructor: NewDefaultStreamerConfig},
		{Constructor: NewStreamer},
	}
)

Functions

func NewStreamer

func NewStreamer(bus *Client, opts StreamerConfig) (nats.JetStreamContext, error)

NewStreamer is jetstream client

Types

type Client

type Client = nats.Conn

Client alias

func NewConnection

func NewConnection(opts *Config) (bus *Client, err error)

NewConnection of nats client

type Config

type Config = nats.Options

Config alias

func NewDefaultConfig

func NewDefaultConfig(v *viper.Viper) (*Config, error)

type Error

type Error string

Error is constant error

func (Error) Error

func (e Error) Error() string

Error returns error message string

type StreamerConfig

type StreamerConfig = []nats.JSOpt

func NewDefaultStreamerConfig

func NewDefaultStreamerConfig(v *viper.Viper) StreamerConfig

Jump to

Keyboard shortcuts

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