baseapp

package
v5.1.3 Latest Latest
Warning

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

Go to latest
Published: May 5, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseApp

type BaseApp struct {
	// contains filtered or unexported fields
}

func New

func New(appConfig ServerConfig, logger log.Log, notifier errors.ErrorNotifier) *BaseApp

func (*BaseApp) GetConfig

func (b *BaseApp) GetConfig() ServerConfig

func (*BaseApp) GetContextWithCorrelation

func (b *BaseApp) GetContextWithCorrelation(ctx context.Context, c *log.CorrelationParam) context.Context

func (*BaseApp) GetContextWithCustomerId

func (b *BaseApp) GetContextWithCustomerId(ctx context.Context, c *log.CustomerIdentifier) context.Context

func (*BaseApp) GetLogger

func (b *BaseApp) GetLogger() log.Log

func (*BaseApp) GetNotifier

func (b *BaseApp) GetNotifier() errors.ErrorNotifier

func (*BaseApp) PanicRecovery

func (b *BaseApp) PanicRecovery(ctx context.Context, rec any) (string, error)

func (*BaseApp) ProcessError

func (b *BaseApp) ProcessError(ctx context.Context, stackTrace string, err error) (int, []byte)

func (*BaseApp) RegisterHealthCheckHook

func (b *BaseApp) RegisterHealthCheckHook(handler HealthCheckHook)

func (*BaseApp) RegisterHooks

func (b *BaseApp) RegisterHooks(hook any)

func (*BaseApp) RegisterOnShutdownHook

func (b *BaseApp) RegisterOnShutdownHook(handler ShutdownHook)

func (*BaseApp) RegisterStatusCheckHook

func (b *BaseApp) RegisterStatusCheckHook(handler StatusCheckHook)

func (*BaseApp) RunHealthCheck

func (b *BaseApp) RunHealthCheck(ctx context.Context) error

func (*BaseApp) RunStatusCheck

func (b *BaseApp) RunStatusCheck(ctx context.Context) map[string]any

func (*BaseApp) SetErrorNotifier

func (b *BaseApp) SetErrorNotifier(errorNotifier errors.ErrorNotifier)

func (*BaseApp) Shutdown

func (b *BaseApp) Shutdown(ctx context.Context)

func (*BaseApp) StartSignalMonitor

func (b *BaseApp) StartSignalMonitor(ctx context.Context) error

func (*BaseApp) WaitForCompleteShutDown

func (b *BaseApp) WaitForCompleteShutDown()

type HealthCheckHook

type HealthCheckHook interface {
	Name(ctx context.Context) string
	HealthCheck(ctx context.Context) error
}

type ServerConfig

type ServerConfig struct {
	ServiceName string
}

type ShutdownHook

type ShutdownHook interface {
	Name(ctx context.Context) string
	Shutdown(ctx context.Context) error
}

type StatusCheckHook

type StatusCheckHook interface {
	Name(ctx context.Context) string
	StatusCheck(ctx context.Context) (any, error)
}

Jump to

Keyboard shortcuts

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