Documentation ¶
Index ¶
- type ConsumerHook
- type ConsumerOption
- func WithConsumerAfterExit(hook ConsumerHook) ConsumerOption
- func WithConsumerAfterRun(hook ConsumerHook) ConsumerOption
- func WithConsumerBeforeExit(hook ConsumerHook) ConsumerOption
- func WithConsumerBeforeRun(hook ConsumerHook) ConsumerOption
- func WithConsumerEnable(enable bool) ConsumerOption
- func WithConsumerLogger(logger leafLogger.Logger) ConsumerOption
- func WithConsumerRegister(hook ConsumerHook) ConsumerOption
- type HealthCheckHook
- type HttpErrorHandler
- type HttpHook
- type HttpOption
- func WithFeatureFlags(ff map[string]interface{}) HttpOption
- func WithHttpAfterExit(hook HttpHook) HttpOption
- func WithHttpAfterRun(hook HttpHook) HttpOption
- func WithHttpBeforeExit(hook HttpHook) HttpOption
- func WithHttpBeforeRun(hook HttpHook) HttpOption
- func WithHttpEnable(enable bool) HttpOption
- func WithHttpErrorHandler(hook HttpErrorHandler) HttpOption
- func WithHttpGraceFulPeriod(duration time.Duration) HttpOption
- func WithHttpHealthAccessKey(accessKey string) HttpOption
- func WithHttpHealthCheck(hook HealthCheckHook) HttpOption
- func WithHttpLogger(logger leafLogger.Logger) HttpOption
- func WithHttpPort(port int) HttpOption
- func WithHttpRegister(hook HttpHook) HttpOption
- func WithHttpValidator(validator leafValidator.Validator) HttpOption
- type HttpServer
- type MessagingServer
- type ProfilerOption
- type ProfilerServer
- type WorkerHook
- type WorkerOption
- func WithWorkerAfterExit(hook WorkerHook) WorkerOption
- func WithWorkerAfterRun(hook WorkerHook) WorkerOption
- func WithWorkerBeforeExit(hook WorkerHook) WorkerOption
- func WithWorkerBeforeRun(hook WorkerHook) WorkerOption
- func WithWorkerEnable(enable bool) WorkerOption
- func WithWorkerLogger(logger leafLogger.Logger) WorkerOption
- func WithWorkerRegister(hook WorkerHook) WorkerOption
- type WorkerServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConsumerHook ¶
type ConsumerHook func(consumer leafMQ.Consumer, logger leafLogger.Logger)
type ConsumerOption ¶
type ConsumerOption interface {
Apply(o *consumerOptions)
}
func WithConsumerAfterExit ¶
func WithConsumerAfterExit(hook ConsumerHook) ConsumerOption
func WithConsumerAfterRun ¶
func WithConsumerAfterRun(hook ConsumerHook) ConsumerOption
func WithConsumerBeforeExit ¶
func WithConsumerBeforeExit(hook ConsumerHook) ConsumerOption
func WithConsumerBeforeRun ¶
func WithConsumerBeforeRun(hook ConsumerHook) ConsumerOption
func WithConsumerEnable ¶
func WithConsumerEnable(enable bool) ConsumerOption
func WithConsumerLogger ¶
func WithConsumerLogger(logger leafLogger.Logger) ConsumerOption
func WithConsumerRegister ¶
func WithConsumerRegister(hook ConsumerHook) ConsumerOption
type HealthCheckHook ¶
type HttpErrorHandler ¶
type HttpErrorHandler func(err error, eCtx echo.Context)
type HttpHook ¶
type HttpHook func(ec *echo.Echo, logger leafLogger.Logger)
type HttpOption ¶
type HttpOption interface {
Apply(o *httpOptions)
}
func WithFeatureFlags ¶
func WithFeatureFlags(ff map[string]interface{}) HttpOption
func WithHttpAfterExit ¶
func WithHttpAfterExit(hook HttpHook) HttpOption
func WithHttpAfterRun ¶
func WithHttpAfterRun(hook HttpHook) HttpOption
func WithHttpBeforeExit ¶
func WithHttpBeforeExit(hook HttpHook) HttpOption
func WithHttpBeforeRun ¶
func WithHttpBeforeRun(hook HttpHook) HttpOption
func WithHttpEnable ¶
func WithHttpEnable(enable bool) HttpOption
func WithHttpErrorHandler ¶
func WithHttpErrorHandler(hook HttpErrorHandler) HttpOption
func WithHttpGraceFulPeriod ¶
func WithHttpGraceFulPeriod(duration time.Duration) HttpOption
func WithHttpHealthAccessKey ¶
func WithHttpHealthAccessKey(accessKey string) HttpOption
func WithHttpHealthCheck ¶
func WithHttpHealthCheck(hook HealthCheckHook) HttpOption
func WithHttpLogger ¶
func WithHttpLogger(logger leafLogger.Logger) HttpOption
func WithHttpPort ¶
func WithHttpPort(port int) HttpOption
func WithHttpRegister ¶
func WithHttpRegister(hook HttpHook) HttpOption
func WithHttpValidator ¶
func WithHttpValidator(validator leafValidator.Validator) HttpOption
type HttpServer ¶
type HttpServer struct {
// contains filtered or unexported fields
}
func NewHttp ¶
func NewHttp(serviceName, serviceVersion string, opts ...HttpOption) *HttpServer
func (*HttpServer) Serve ¶
func (s *HttpServer) Serve(sig chan os.Signal)
func (*HttpServer) Shutdown ¶
func (s *HttpServer) Shutdown()
type MessagingServer ¶
type MessagingServer struct {
// contains filtered or unexported fields
}
func NewMessaging ¶
func NewMessaging(consumer leafMQ.Consumer, opts ...ConsumerOption) *MessagingServer
func (*MessagingServer) Serve ¶
func (s *MessagingServer) Serve(sig chan os.Signal)
func (*MessagingServer) Shutdown ¶
func (s *MessagingServer) Shutdown()
type ProfilerOption ¶
type ProfilerOption interface {
Apply(o *profilerOptions)
}
func WithProfilerEnable ¶
func WithProfilerEnable(enable bool) ProfilerOption
func WithProfilerLogger ¶
func WithProfilerLogger(logger leafLogger.Logger) ProfilerOption
func WithProfilerProjectID ¶
func WithProfilerProjectID(projectID string) ProfilerOption
type ProfilerServer ¶
type ProfilerServer struct {
// contains filtered or unexported fields
}
func NewProfiler ¶
func NewProfiler(serviceName, serviceVersion string, opts ...ProfilerOption) *ProfilerServer
func (*ProfilerServer) Serve ¶
func (p *ProfilerServer) Serve(sig chan os.Signal)
func (*ProfilerServer) Shutdown ¶
func (p *ProfilerServer) Shutdown()
type WorkerHook ¶
type WorkerHook func(runners *leafWorker.Runners, logger leafLogger.Logger)
type WorkerOption ¶
type WorkerOption interface {
Apply(o *workerOptions)
}
func WithWorkerAfterExit ¶
func WithWorkerAfterExit(hook WorkerHook) WorkerOption
func WithWorkerAfterRun ¶
func WithWorkerAfterRun(hook WorkerHook) WorkerOption
func WithWorkerBeforeExit ¶
func WithWorkerBeforeExit(hook WorkerHook) WorkerOption
func WithWorkerBeforeRun ¶
func WithWorkerBeforeRun(hook WorkerHook) WorkerOption
func WithWorkerEnable ¶
func WithWorkerEnable(enable bool) WorkerOption
func WithWorkerLogger ¶
func WithWorkerLogger(logger leafLogger.Logger) WorkerOption
func WithWorkerRegister ¶
func WithWorkerRegister(hook WorkerHook) WorkerOption
type WorkerServer ¶
type WorkerServer struct {
// contains filtered or unexported fields
}
func NewWorker ¶
func NewWorker(opts ...WorkerOption) *WorkerServer
====================
WorkerServer
====================
func (*WorkerServer) Serve ¶
func (s *WorkerServer) Serve(sig chan os.Signal)
func (*WorkerServer) Shutdown ¶
func (s *WorkerServer) Shutdown()
Click to show internal directories.
Click to hide internal directories.