app

package
v0.0.1-beta.3 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2022 License: GPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exit

func Exit(errFn func() error, l logr.Logger)

Exit функция в зависимости от результат errFn выполнить os.Exit.

Если errFn вернет ошибку не типа ErrorOSSignal, то os.Exit(1), иначе return. nolint:interfacer // дублирование интерфейса logr.

func RecoverExit

func RecoverExit(l logr.Logger)

func SignalNotify

func SignalNotify(ctx context.Context) error

SignalNotify обработка событий выхода от ОС.

Types

type App

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

func NewApp

func NewApp() *App

func NewAppWithOpts

func NewAppWithOpts(opts ...Option) *App

func (*App) AddClosers

func (a *App) AddClosers(cls ...func()) *App

func (*App) AddWorkers

func (a *App) AddWorkers(rs ...processes.Process) *App

func (*App) Close

func (a *App) Close()

func (*App) Logger

func (a *App) Logger() logr.Logger

func (*App) Run

func (a *App) Run()

type ErrorOSSignal

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

ErrorOSSignal обертка в виде ошибки над сигналом ОС для того, чтобы использовать SignalNotify в errgroup.

func (*ErrorOSSignal) Error

func (e *ErrorOSSignal) Error() string

type Option

type Option func(app *App)

func WithContext

func WithContext(ctx context.Context) Option

func WithCustomLogger

func WithCustomLogger(logger logr.Logger) Option

Jump to

Keyboard shortcuts

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