message

package
v1.25.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: MIT Imports: 14 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, vllme vllmEstimator, aze azureEstimator, v validator, uv userValidator, km keyManager, um userManager, rlm rateLimitManager, ac accessCache, uac 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