nats

package
v0.0.0-...-318a3d5 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsEqual

func IsEqual(a1 []string, a2 []string) bool

func NewKeptnNatsMessageHandler

func NewKeptnNatsMessageHandler(f processFunc) *keptnNatsMessageHandler

Types

type IKeptnNatsMessageHandler

type IKeptnNatsMessageHandler interface {
	Process(event apimodels.KeptnContextExtendedCE, sync bool) error
}

type NatsConnectionHandler

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

func NewNatsConnectionHandler

func NewNatsConnectionHandler(ctx context.Context, natsURL string) *NatsConnectionHandler

func (*NatsConnectionHandler) GetPublisher

func (nch *NatsConnectionHandler) GetPublisher() (*Publisher, error)

func (*NatsConnectionHandler) RemoveAllSubscriptions

func (nch *NatsConnectionHandler) RemoveAllSubscriptions()

func (*NatsConnectionHandler) SubscribeToTopics

func (nch *NatsConnectionHandler) SubscribeToTopics(topics []string, messageHandler IKeptnNatsMessageHandler) error

SubscribeToTopics expresses interest in the given subject(s) on the NATS message broker.

type Publisher

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

func NewPublisher

func NewPublisher(natsConnection *nats.Conn) *Publisher

func (*Publisher) Send

func (p *Publisher) Send(ctx context.Context, event cloudevents.Event) error

Send sends a cloud event

func (*Publisher) SendEvent

func (p *Publisher) SendEvent(event cloudevents.Event) error

type PullSubscription

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

func NewPullSubscription

func NewPullSubscription(ctx context.Context, queueGroup, topic string, js nats.JetStreamContext, messageHandler func(event apimodels.KeptnContextExtendedCE, sync bool) error) *PullSubscription

func (*PullSubscription) Activate

func (ps *PullSubscription) Activate() error

func (*PullSubscription) Unsubscribe

func (ps *PullSubscription) Unsubscribe() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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