Version: v1.6.17 Latest Latest

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

Go to latest
Published: Aug 4, 2021 License: Apache-2.0 Imports: 4 Imported by: 1




View Source
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"


This section is empty.


This section is empty.


type Database

type Database int

Database enum

const (
	// SQL database type
	SQL Database = iota

	// Mongo database type

	// Redis database type

	// ElasticSearch database type

type MiddlewareFunc

type MiddlewareFunc func(context.Context) context.Context

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 interface{}, middlewareFunc ...MiddlewareFunc)

AddProto register proto for grpc middleware

type Module

type Module string

Module is the type returned by a Classifier module

type Server

type Server string

Server is the type returned by a classifier server (REST, gRPC, GraphQL)

type Service

type Service string

Service is the type returned by a classifier service name

type Worker

type Worker string

Worker is the type returned by a classifier worker (kafka, redis subscriber, rabbitmq, scheduler, task queue)

type WorkerErrorHandler

type WorkerErrorHandler func(ctx context.Context, workerType Worker, workerName string, message []byte, err error)

WorkerErrorHandler types

type WorkerHandler added in v1.6.11

type WorkerHandler struct {
	Pattern      string
	HandlerFunc  WorkerHandlerFunc
	ErrorHandler WorkerErrorHandler
	DisableTrace bool
	AutoACK      bool

WorkerHandler types

type WorkerHandlerFunc

type WorkerHandlerFunc func(ctx context.Context, message []byte) 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(pattern string, handlerFunc WorkerHandlerFunc, opts ...WorkerHandlerOptionFunc)

Add method from WorkerHandlerGroup, pattern can contains unique topic name, key, and task name

type WorkerHandlerOptionFunc added in v1.6.11

type WorkerHandlerOptionFunc func(*WorkerHandler)

WorkerHandlerOptionFunc types

func WorkerHandlerOptionAddErrorHandler added in v1.6.11

func WorkerHandlerOptionAddErrorHandler(errHandler WorkerErrorHandler) WorkerHandlerOptionFunc

WorkerHandlerOptionAddErrorHandler add error handlers

func WorkerHandlerOptionAutoACK added in v1.6.11

func WorkerHandlerOptionAutoACK(auto bool) WorkerHandlerOptionFunc

WorkerHandlerOptionAutoACK set disable trace

func WorkerHandlerOptionDisableTrace added in v1.6.11

func WorkerHandlerOptionDisableTrace() WorkerHandlerOptionFunc

WorkerHandlerOptionDisableTrace set disable trace

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL