natsclient

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package natsclient provides functionalities for interacting with a NATS broker for fetching input data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DashboardClient

type DashboardClient interface {
	FetchMessage() string
}

DashboardClient represents the domain-specific API that the service uses when interacting with the data source, hiding any infrastucture concerns.

type DashboardNATSClient

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

DashboardNATSClient interacts with a NATS broker for fetching input data.

func NewDashboardNATSClient

func NewDashboardNATSClient() (*DashboardNATSClient, error)

NewDashboardNATSClient is a constructor function for creating a connected and operational DashboardNATSClient.

func (*DashboardNATSClient) Consume added in v1.3.1

func (d *DashboardNATSClient) Consume(out chan []byte)

Consume is an adapter of jetstream.Consumer.Consume. It takes a channel as input, fetches NATS messages using the NATS connections, and sends them to the channel for further processing.

type NATSConnection

type NATSConnection struct {
	NATSConn  *nats.Conn
	Consumer  jetstream.Consumer
	Ctx       context.Context
	CancelCtx context.CancelFunc
}

NATSConnection holds the infrastructure concerns regarding the interaction with the NATS broker.

Jump to

Keyboard shortcuts

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