stream

package
v0.0.0-...-c39517e Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	SendMessage(topic string, value []byte) error
	Subscribe(topic string, f func([]byte)) error
	Close()
}

Client provides the interface for streaming messages

func NewNATS

func NewNATS(url, group string, options ...nats.Option) Client

NewNATS returns a new stream Client instance

type NATS

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

NATS implements the stream Client interface

func (*NATS) Close

func (n *NATS) Close()

Close drains the NATS subscriptions and connection

func (*NATS) SendMessage

func (n *NATS) SendMessage(topic string, value []byte) error

SendMessage sends a stream message to NATS

func (*NATS) Subscribe

func (n *NATS) Subscribe(topic string, f func([]byte)) error

Subscribe listens to messages on a NATS stream

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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