broker

package
v0.0.0-...-6de64ee Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Broker

type Broker struct {
	State BrokerState
	// contains filtered or unexported fields
}

func NewBroker

func NewBroker(logger *zap.Logger) *Broker

func (*Broker) CreateNewEnviorment

func (b *Broker) CreateNewEnviorment(enviorment string) error

func (*Broker) CreateNewQueueInEnviorment

func (b *Broker) CreateNewQueueInEnviorment(queue string, enviorment string) error

func (*Broker) PublishMessage

func (b *Broker) PublishMessage(enviorment string, queue string, message Message) error

func (*Broker) RemoveEnviorment

func (b *Broker) RemoveEnviorment(enviorment string) error

func (*Broker) RemoveQueueFromEnviorment

func (b *Broker) RemoveQueueFromEnviorment(queue string, enviorment string) error

func (*Broker) SubscribeToQueue

func (b *Broker) SubscribeToQueue(enviorment string, queueName string, connection *net.Conn, subscriberName string) error

type BrokerState

type BrokerState struct {
	Logger      *zap.Logger
	Enviorments map[string]Enviorment
}

type Consumer

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

type Enviorment

type Enviorment struct {
	Name   string
	Queues map[string]Queue
}

type Message

type Message struct {
	ID        string
	Body      []byte
	Timestamp time.Time
}

func NewBrokerMessage

func NewBrokerMessage(body []byte) *Message

type Queue

type Queue struct {
	Name        string
	Description string
	CreatedAt   time.Time
	Subscribers []Consumer
	Messages    []Message
}

Jump to

Keyboard shortcuts

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