Documentation
¶
Index ¶
- Variables
- func Get[T Module](kind ModuleKind) []T
- func NewDelayEventModule(moduleObject any, app string, functions map[string]DelayEventFunction, ...) error
- func NewEventModule(moduleObject any, app, pubsub string, functions map[string]EventFunction, ...) error
- func NewHealthModule(moduleObject any, app string, fn HealthCheckFunction) error
- func NewInvocationModule(moduleObject any, app string, alias2handler map[string]InvocationFunction) error
- type DelayEventFunction
- type DelayEventHandler
- type DelayEventModule
- type DelayEventModuleOption
- type EventFunction
- type EventModule
- type EventModuleOption
- type HandlerMatcher
- type HealthCheckFunction
- type HealthModule
- type Info
- type InvocationFunction
- type InvocationModule
- type Module
- type ModuleKind
Constants ¶
This section is empty.
Variables ¶
View Source
var (
EmptyHealthCheckFunction = func(ctx context.Context) (err error) { return nil }
)
Functions ¶
func Get ¶
func Get[T Module](kind ModuleKind) []T
func NewDelayEventModule ¶
func NewDelayEventModule(moduleObject any, app string, functions map[string]DelayEventFunction, options ...DelayEventModuleOption) error
NewDelayEventModule 初始化延迟消息模块
func NewEventModule ¶
func NewEventModule(moduleObject any, app, pubsub string, functions map[string]EventFunction, options ...EventModuleOption) error
NewEventModule 新建事件模块会执行下列操作:
func NewHealthModule ¶
func NewHealthModule(moduleObject any, app string, fn HealthCheckFunction) error
NewHealthModule 注册健康模块
func NewInvocationModule ¶
func NewInvocationModule(moduleObject any, app string, alias2handler map[string]InvocationFunction) error
Types ¶
type DelayEventFunction ¶
type DelayEventHandler ¶
type DelayEventModule ¶
type DelayEventModule interface {
Module
RegisterHandlers(functions map[string]DelayEventFunction) error // 注册Handlers
GetHandlers() []DelayEventHandler // 获取handlers
GetAckTimeout() time.Duration
GetBackOffPolicy() backoff.BackOff
}
type DelayEventModuleOption ¶
type DelayEventModuleOption func(*delayEventModuleImpl)
func WithBackOff ¶
func WithBackOff(backoff backoff.BackOff) DelayEventModuleOption
type EventModule ¶
type EventModuleOption ¶
type EventModuleOption func(*eventModuleImpl)
func WithConsumerTimeout ¶
func WithConsumerTimeout(duration time.Duration) EventModuleOption
type HandlerMatcher ¶
type HealthCheckFunction ¶
type HealthModule ¶
type HealthModule interface {
Module
GetHandler() common.HealthCheckHandler
}
type Info ¶
func ParseModuleInfo ¶
ParseModuleInfo 合法的包路径可能为以下格式: * /path/to/v1 * /path/to/v1/pc * /path/to/v2/wxmp
type InvocationModule ¶
type InvocationModule interface {
Module
RegisterHandlers(functions map[string]InvocationFunction) error // 注册Handlers
GetHandlers() []invocationHandler // 获取handlers
}
type Module ¶
type Module interface {
GetApp() string
GetInfo() *Info
GetKind() ModuleKind
}
type ModuleKind ¶
type ModuleKind int
const ( ModuleKindUnknown ModuleKind = iota ModuleKindInvocation // service invocation module ModuleKindEvent // topic event module ModuleKindDelayEvent // delay event module ModuleKindHealth // health module )
Click to show internal directories.
Click to hide internal directories.