emitter

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2024 License: Apache-2.0 Imports: 15 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewJetStream

func NewJetStream(url string, creds string, nKeyFile string) *jetStream

NewJetStream initializes jetStream to connect to NATS

Types

type DataFunc

type DataFunc func(*pubsub.Message) error

DataFunc determines how the data return from the pubsub is transformed based on implementation per module

type EmitterPubSub added in v0.5.0

type EmitterPubSub struct {
	ServiceURL string
}

EmitterPubSub stores the serviceURL such that the topic and subscription can be reopened

func NewEmitterPubSub added in v0.5.0

func NewEmitterPubSub(_ context.Context, serviceURL string) *EmitterPubSub

NewEmitterPubSub initializes the blob store based on the url. utilizing gocloud (https://gocloud.dev/howto/pubsub/publish/) various pubsub providers such as sqs, google pubsub, azure service bus, NATS and Kafka can be used. Authentication is setup via environment variables. Please refer to for full documentation https://gocloud.dev/howto/pubsub/

func (*EmitterPubSub) Publish added in v0.5.0

func (e *EmitterPubSub) Publish(ctx context.Context, data []byte) error

Publish publishes the data onto the pubsub stream for consumption by upstream services

func (*EmitterPubSub) Subscribe added in v0.5.0

func (e *EmitterPubSub) Subscribe(ctx context.Context) (*subscriber, error)

Subscribe subscribes to the pubsub stream and receives events as they flow through

Jump to

Keyboard shortcuts

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