brokerstore

package
v0.0.0-...-58c0a64 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BrokerStore

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

BrokerStore holds broker clients

func (*BrokerStore) FlushAllProducers

func (b *BrokerStore) FlushAllProducers(ctx context.Context)

FlushAllProducers will iterate over the producer map, and flush all messages in the producer buffer

func (*BrokerStore) GetAdmin

GetAdmin returns for an existing admin instance, if available returns that else creates as new instance

func (*BrokerStore) GetConsumer

GetConsumer returns for an existing consumer instance, if available returns that else creates as new instance

func (*BrokerStore) GetProducer

GetProducer returns for an existing producer instance, if available returns that else creates as new instance

func (*BrokerStore) IsTopicCleanUpEnabled

func (b *BrokerStore) IsTopicCleanUpEnabled() bool

IsTopicCleanUpEnabled checks if topic clean-up config is enabled or not

func (*BrokerStore) RemoveConsumer

RemoveConsumer deletes the consumer from the store

func (*BrokerStore) RemoveProducer

RemoveProducer deletes the producer from the store followed by a shutdown

type IBrokerStore

type IBrokerStore interface {

	// GetConsumer returns for an existing consumer instance, if available returns that else creates as new instance
	GetConsumer(ctx context.Context, op messagebroker.ConsumerClientOptions) (messagebroker.Consumer, error)

	// RemoveConsumer deletes the consumer from the store
	RemoveConsumer(ctx context.Context, op messagebroker.ConsumerClientOptions) bool

	// GetProducer returns for an existing producer instance, if available returns that else creates as new instance
	GetProducer(ctx context.Context, op messagebroker.ProducerClientOptions) (messagebroker.Producer, error)

	// RemoveProducer deletes the producer from the store followed by a shutdown
	RemoveProducer(ctx context.Context, op messagebroker.ProducerClientOptions) bool

	// GetAdmin returns for an existing admin instance, if available returns that else creates as new instance
	GetAdmin(ctx context.Context, op messagebroker.AdminClientOptions) (messagebroker.Admin, error)

	// FlushAllProducers will iterate over the producer map, and flush all messages in the producer buffer
	FlushAllProducers(ctx context.Context)

	// IsTopicCleanUpEnabled returns true if topicCleanUp is enabled in the env
	IsTopicCleanUpEnabled() bool
}

IBrokerStore ...

func NewBrokerStore

func NewBrokerStore(variant string, config *messagebroker.BrokerConfig) (IBrokerStore, error)

NewBrokerStore returns a concrete implementation IBrokerStore

type Key

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

Key ...

func NewKey

func NewKey(name string, id string) *Key

NewKey creates a new key for broker map

func (*Key) Prefix

func (key *Key) Prefix() string

Prefix returns only the topic name to run a match all query

func (*Key) String

func (key *Key) String() string

Jump to

Keyboard shortcuts

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