adapters

package
v0.0.0-...-e080771 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2025 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StanEvent

type StanEvent cloudevents.Event

StanEvent implements types.Event

func (StanEvent) EventType

func (event StanEvent) EventType() types.EventType

EventType returns the type of the event, implements types.EventType

type StanSink

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

StanSink is a NATS Streaming event sink to publish events into.

func NewStanSink

func NewStanSink(clientID string) *StanSink

NewStanSink creates new StanSink

func (StanSink) Close

func (sink StanSink) Close()

Close performs a cleanup. NATS Streaming connection will be closed.

func (StanSink) ConnLost

func (sink StanSink) ConnLost() <-chan struct{}

ConnLost returns the connection lost notifier channel

func (*StanSink) InitSink

func (sink *StanSink) InitSink(conf types.StanConfig) error

InitSink initialize StanSink, establish the connection.

func (StanSink) Publish

func (sink StanSink) Publish(event types.Event) error

Publish publish an event to the StanSink

type StanSrc

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

StanSrc is a NATS Streaming event source to receive events from.

func NewStanSrc

func NewStanSrc(name, clientID string) *StanSrc

NewStanSrc creates a new StanSrc

func (StanSrc) Close

func (src StanSrc) Close()

Close performs a cleanup. The NATS Streaming connection will be closed, and the NATS Streaming subscription will be closed but not unsubscribed.

func (*StanSrc) InitChannel

func (src *StanSrc) InitChannel(chann chan<- types.Event)

InitChannel sets the channel that StanSrc will publish events into.

func (*StanSrc) InitSrc

func (src *StanSrc) InitSrc(conf types.StanConfig) error

InitSrc initialize the StanSrc, establish the connection.

func (StanSrc) Start

func (src StanSrc) Start() error

Start starts the NATS Streaming subscription, and start pushing events received from NATS Streaming into the go channel.

Jump to

Keyboard shortcuts

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