stream

package
v2.16.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package stream provides streaming clients used by `Consume` and `Publish` methods

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Nats

func Nats(opts ...natsjs.Option) (events.Stream, error)

nats returns a nats streaming client retries exponentially to connect to a nats server

func NatsFromConfig

func NatsFromConfig(connName string, cfg NatsConfig) (events.Stream, error)

NatsFromConfig returns a nats stream from the given config

Types

type Chan

type Chan [2]chan interface{}

Chan is a channel based streaming clients Useful for tests or in memory applications

func (Chan) Consume

func (ch Chan) Consume(_ string, _ ...events.ConsumeOption) (<-chan events.Event, error)

Consume implementation

func (Chan) Publish

func (ch Chan) Publish(_ string, msg interface{}, _ ...events.PublishOption) error

Publish implementation

type NatsConfig

type NatsConfig struct {
	Endpoint             string // Endpoint of the nats server
	Cluster              string // CluserID of the nats cluster
	TLSInsecure          bool   // Whether to verify TLS certificates
	TLSRootCACertificate string // The root CA certificate used to validate the TLS certificate
	EnableTLS            bool   // Enable TLS
}

NatsConfig is the configuration needed for a NATS event stream

Jump to

Keyboard shortcuts

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