message

package
v1.9.5 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Consumer

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

func NewConsumer

func NewConsumer(mc <-chan Message, log *zap.Logger, num int, handle func(Message) error) *Consumer

func (*Consumer) StartEventMessageConsumers

func (c *Consumer) StartEventMessageConsumers()

func (*Consumer) Stop

func (c *Consumer) Stop()

type Handler

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

func NewHandler

func NewHandler(r recorder, log *zap.Logger, ae anthropicEstimator, e estimator, aze azureEstimator, v validator, km keyManager, rlm rateLimitManager, ac accessCache) *Handler

func (*Handler) HandleEvent

func (h *Handler) HandleEvent(m Message) error

func (*Handler) HandleEventWithRequestAndResponse

func (h *Handler) HandleEventWithRequestAndResponse(m Message) error

type Message

type Message struct {
	Type string
	Data interface{}
}

type MessageBus

type MessageBus struct {
	Subscribers map[string][]chan<- Message
}

func NewMessageBus

func NewMessageBus() *MessageBus

func (*MessageBus) Publish

func (mb *MessageBus) Publish(ms Message)

func (*MessageBus) Subscribe

func (mb *MessageBus) Subscribe(messageType string, subscriber chan<- Message)

Jump to

Keyboard shortcuts

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