brokers

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSidecarConnectionVars

func GetSidecarConnectionVars(broker string) *models.ConnectionVariables

GetSidecarConnectionVars returns port enviroment variable names for each possible broker

func ResetBrokerMemory

func ResetBrokerMemory()

ResetBrokerMemory makes the BrokersManagers singleton points to nil, used only in tests

Types

type AbstractBrokerFactory

type AbstractBrokerFactory struct {
}

AbstractBrokerFactory singleton and abstract factory implementation for SidecarInterface

func (*AbstractBrokerFactory) Get

Get returns a factory for the specifyed broker

func (*AbstractBrokerFactory) Subscribe

func (abf *AbstractBrokerFactory) Subscribe(broker string, factory models.SidecarFactory) error

Subscribe includes a broker specific factory on the Abstract broker factory

type BrokerMemoryManager

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

BrokerMemoryManager implements the methods described by the BrokersInterface

func (*BrokerMemoryManager) Configs

Configs returns the configurations for a given broker

func (*BrokerMemoryManager) Create

Create configures a new broker on insprd

func (*BrokerMemoryManager) Factory

func (bmm *BrokerMemoryManager) Factory() SidecarManager

Factory provides the struct implementation for Sidecarfactory

func (*BrokerMemoryManager) GetAll

func (bmm *BrokerMemoryManager) GetAll() (utils.StringArray, error)

GetAll returns an array containing all currently configured brokers

func (*BrokerMemoryManager) GetDefault

func (bmm *BrokerMemoryManager) GetDefault() (string, error)

GetDefault returns the broker configured as default

func (*BrokerMemoryManager) SetDefault

func (bmm *BrokerMemoryManager) SetDefault(broker string) error

SetDefault sets a previously configured broker as insprd's default broker

type Manager

type Manager interface {
	GetAll() (utils.StringArray, error)
	GetDefault() (string, error)
	Create(config brokers.BrokerConfiguration) error
	SetDefault(broker string) error
	Factory() SidecarManager
	Configs(broker string) (brokers.BrokerConfiguration, error)
}

Manager is the interface that allows for interaction with the systems multiple brokers and its configurations.

func GetBrokerMemory

func GetBrokerMemory() Manager

GetBrokerMemory allows for connection with BrokersManager sigleton

type SidecarManager

type SidecarManager interface {
	Get(broker string) (models.SidecarFactory, error)
	Subscribe(broker string, factory models.SidecarFactory) error
}

SidecarManager is the interface that allows the build and deployment of available brokers

Jump to

Keyboard shortcuts

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