leafServer

package
v0.0.0-...-0829b1e Latest Latest
Warning

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

Go to latest
Published: May 23, 2022 License: MIT Imports: 16 Imported by: 1

Documentation

Index

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 HealthCheckHook func(ctx context.Context) (int, map[string]map[string]interface{})

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()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL