Documentation ¶
Index ¶
- Constants
- type Database
- type MiddlewareFunc
- type MiddlewareGroup
- type Module
- type Server
- type Service
- type Worker
- type WorkerHandler
- type WorkerHandlerFunc
- type WorkerHandlerGroup
- type WorkerHandlerOptionFunc
- func WorkerHandlerOptionAddConfig(key string, value any) WorkerHandlerOptionFunc
- func WorkerHandlerOptionAddHandlers(handlerFuncs ...WorkerHandlerFunc) WorkerHandlerOptionFunc
- func WorkerHandlerOptionAutoACK(auto bool) WorkerHandlerOptionFunc
- func WorkerHandlerOptionDisableTrace() WorkerHandlerOptionFunc
Constants ¶
const ( // REST server REST Server = "rest" // GRPC server GRPC Server = "grpc" // GraphQL server GraphQL Server = "graphql" // Kafka worker Kafka Worker = "kafka" // RedisSubscriber worker RedisSubscriber Worker = "redis_subscriber" // RabbitMQ worker RabbitMQ Worker = "rabbit_mq" // Scheduler worker Scheduler Worker = "scheduler" // TaskQueue worker TaskQueue Worker = "task_queue" // PostgresListener worker PostgresListener Worker = "postgres_listener" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MiddlewareFunc ¶
MiddlewareFunc type
type MiddlewareGroup ¶
type MiddlewareGroup map[string][]MiddlewareFunc
MiddlewareGroup type
func (MiddlewareGroup) Add ¶
func (mw MiddlewareGroup) Add(fullMethod string, middlewareFunc ...MiddlewareFunc)
Add register full method to middleware
func (MiddlewareGroup) AddProto ¶
func (mw MiddlewareGroup) AddProto(protoDesc protoreflect.FileDescriptor, handler any, middlewareFunc ...MiddlewareFunc)
AddProto register proto for grpc middleware
type Server ¶
type Server string
Server is the type returned by a classifier server (REST, gRPC, GraphQL)
type Worker ¶
type Worker string
Worker is the type returned by a classifier worker (kafka, redis subscriber, rabbitmq, scheduler, task queue)
type WorkerHandler ¶ added in v1.6.11
type WorkerHandler struct { Pattern string HandlerFuncs []WorkerHandlerFunc DisableTrace bool AutoACK bool Configs map[string]any }
WorkerHandler types
type WorkerHandlerFunc ¶
type WorkerHandlerFunc func(ctx *candishared.EventContext) error
WorkerHandlerFunc types
type WorkerHandlerGroup ¶
type WorkerHandlerGroup struct {
Handlers []WorkerHandler
}
WorkerHandlerGroup group of worker handlers by pattern string
func (*WorkerHandlerGroup) Add ¶
func (m *WorkerHandlerGroup) Add(patternRoute string, mainHandlerFunc WorkerHandlerFunc, opts ...WorkerHandlerOptionFunc)
Add method from WorkerHandlerGroup, patternRoute can contains unique topic name, key, or task name
func (*WorkerHandlerGroup) AddMultiRoute ¶ added in v1.18.3
func (m *WorkerHandlerGroup) AddMultiRoute(patternRoutes []string, mainHandlerFunc WorkerHandlerFunc, opts ...WorkerHandlerOptionFunc)
AddMultiRoute method from WorkerHandlerGroup to handle multi topic in single method
type WorkerHandlerOptionFunc ¶ added in v1.6.11
type WorkerHandlerOptionFunc func(*WorkerHandler)
WorkerHandlerOptionFunc types
func WorkerHandlerOptionAddConfig ¶ added in v1.13.0
func WorkerHandlerOptionAddConfig(key string, value any) WorkerHandlerOptionFunc
WorkerHandlerOptionAddConfig set config
func WorkerHandlerOptionAddHandlers ¶ added in v1.10.0
func WorkerHandlerOptionAddHandlers(handlerFuncs ...WorkerHandlerFunc) WorkerHandlerOptionFunc
WorkerHandlerOptionAddHandlers add after handlers execute after main handler
func WorkerHandlerOptionAutoACK ¶ added in v1.6.11
func WorkerHandlerOptionAutoACK(auto bool) WorkerHandlerOptionFunc
WorkerHandlerOptionAutoACK set auto ACK
func WorkerHandlerOptionDisableTrace ¶ added in v1.6.11
func WorkerHandlerOptionDisableTrace() WorkerHandlerOptionFunc
WorkerHandlerOptionDisableTrace set disable trace