Documentation ¶
Overview ¶
Package pubsub is a simple in-memory pub sub.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventTopic ¶
type EventTopic string
func (EventTopic) EventTopic ¶
func (e EventTopic) EventTopic() string
type MiddlewareFunc ¶
type MiddlewareFunc func(next HandleFunc) HandleFunc
type Pub ¶
type Pub struct {
// contains filtered or unexported fields
}
func NewPub ¶
func NewPub(middleware ...MiddlewareFunc) *Pub
func (*Pub) Subscribe ¶
func (p *Pub) Subscribe() SubscribeBuilder
type State ¶
type State struct { SubscriberCount int Subscribers []StateSubscriber }
type StateSubscriber ¶
type StateSubscriber struct {
ID int
}
type Sub ¶
type Sub struct {
// contains filtered or unexported fields
}
type SubscribeBuilder ¶
type SubscribeBuilder struct {
// contains filtered or unexported fields
}
func (SubscribeBuilder) Function ¶
func (b SubscribeBuilder) Function(fn HandleFunc) (Sub, error)
Function creates a subscription with a function.
func (SubscribeBuilder) Middleware ¶
func (b SubscribeBuilder) Middleware(fn MiddlewareFunc) SubscribeBuilder
Middleware add a middleware between the handler and publisher.
Click to show internal directories.
Click to hide internal directories.