Documentation ¶
Index ¶
- type Broker
- type BrokerInstance
- type BrokerInstanceDefault
- type BrokerPlugin
- func (b *BrokerPlugin) AppendMiddlewares() []web.MiddlewareFunc
- func (b *BrokerPlugin) Instance() interface{}
- func (b *BrokerPlugin) Name() string
- func (b *BrokerPlugin) OnCreated(z *zepto.Zepto)
- func (b *BrokerPlugin) OnZeptoInit(z *zepto.Zepto)
- func (b *BrokerPlugin) OnZeptoStart(z *zepto.Zepto)
- func (b *BrokerPlugin) OnZeptoStop(z *zepto.Zepto)
- func (b *BrokerPlugin) PrependMiddlewares() []web.MiddlewareFunc
- type BrokerProvider
- type DefaultSubscriptionContext
- type InitOptions
- type Message
- type Options
- type SubscribeHandler
- type SubscriptionContext
- type SubscriptionsMap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Broker ¶
type Broker struct {
// contains filtered or unexported fields
}
BrokerWrapper is a struct that wrap the broker provider (gcp, rabbitmq, etc) and handle with message encode/decode
func NewBroker ¶
func NewBroker(provider BrokerProvider) *Broker
func (*Broker) GracefulStop ¶
GracefulStop graceful stop all subscriptions
func (*Broker) Init ¶
func (b *Broker) Init(opts *InitOptions)
type BrokerInstance ¶
func InstanceFromCtx ¶
func InstanceFromCtx(ctx web.Context) BrokerInstance
type BrokerInstanceDefault ¶
type BrokerInstanceDefault struct {
// contains filtered or unexported fields
}
type BrokerPlugin ¶
type BrokerPlugin struct {
// contains filtered or unexported fields
}
func NewBrokerPlugin ¶
func NewBrokerPlugin(opts Options) *BrokerPlugin
func (*BrokerPlugin) AppendMiddlewares ¶
func (b *BrokerPlugin) AppendMiddlewares() []web.MiddlewareFunc
func (*BrokerPlugin) Instance ¶
func (b *BrokerPlugin) Instance() interface{}
func (*BrokerPlugin) Name ¶
func (b *BrokerPlugin) Name() string
func (*BrokerPlugin) OnCreated ¶
func (b *BrokerPlugin) OnCreated(z *zepto.Zepto)
func (*BrokerPlugin) OnZeptoInit ¶
func (b *BrokerPlugin) OnZeptoInit(z *zepto.Zepto)
func (*BrokerPlugin) OnZeptoStart ¶
func (b *BrokerPlugin) OnZeptoStart(z *zepto.Zepto)
func (*BrokerPlugin) OnZeptoStop ¶
func (b *BrokerPlugin) OnZeptoStop(z *zepto.Zepto)
func (*BrokerPlugin) PrependMiddlewares ¶
func (b *BrokerPlugin) PrependMiddlewares() []web.MiddlewareFunc
type BrokerProvider ¶
type DefaultSubscriptionContext ¶
type DefaultSubscriptionContext struct { context.Context BrokerInstance BrokerInstance }
func (*DefaultSubscriptionContext) Broker ¶
func (sc *DefaultSubscriptionContext) Broker() BrokerInstance
type InitOptions ¶
type InitOptions struct { Logger logger.Logger Instance BrokerInstance }
type Options ¶
type Options struct { Provider BrokerProvider Subscriptions SubscriptionsMap }
type SubscribeHandler ¶
type SubscribeHandler func(ctx SubscriptionContext, msg *Message)
type SubscriptionContext ¶
type SubscriptionContext interface { context.Context Broker() BrokerInstance }
type SubscriptionsMap ¶
type SubscriptionsMap map[string]interface{}
Click to show internal directories.
Click to hide internal directories.