emitter

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

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