keel

package
v0.1.24 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MetadataEventName = "X-Event-Name"
)

Variables

View Source
var (
	ErrMissingEventName = errors.New("missing event name")
	ErrContextCanceled  = errors.New("request stopped without ACK received")
	ErrMessageNacked    = errors.New("message nacked")
	ErrClosed           = errors.New("subscriber already closed")
)

Functions

This section is empty.

Types

type Subscriber

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

func NewSubscriber

func NewSubscriber(l *zap.Logger, opts ...SubscriberOption) *Subscriber

func (*Subscriber) Close

func (s *Subscriber) Close() error

Close closes all subscriptions with their output channels and flush offsets etc. when needed.

func (*Subscriber) ServeHTTP

func (s *Subscriber) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Subscriber) Subscribe

func (s *Subscriber) Subscribe(ctx context.Context, topic string) (<-chan *message.Message, error)

type SubscriberHandler

type SubscriberHandler func(l *zap.Logger, r *http.Request, event *mpv2.Event) error

type SubscriberMiddleware

type SubscriberMiddleware func(next SubscriberHandler) SubscriberHandler

type SubscriberOption

type SubscriberOption func(*Subscriber)

func SubscriberWithLogger

func SubscriberWithLogger(fields ...zap.Field) SubscriberOption

func SubscriberWithMiddlewares

func SubscriberWithMiddlewares(v ...SubscriberMiddleware) SubscriberOption

func SubscriberWithRequireEventName

func SubscriberWithRequireEventName() SubscriberOption

func SubscriberWithUUIDFunc

func SubscriberWithUUIDFunc(v func() string) SubscriberOption

Jump to

Keyboard shortcuts

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