template

package
v0.0.0-...-35a4376 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RunFunctionMessageStart        = "run service"
	RunFunctionMessageExitBySignal = "exit"
)
View Source
const (
	StopFunctionMessageIsStopping = "service is stopping..."
	StopFunctionExecutionWarning  = "executing stopping function"
	StopFunctionMessageFinished   = "service has stopped"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Template

type Template[ConfigType config.WithValidation] struct {
	// contains filtered or unexported fields
}

func NewTemplate

func NewTemplate[ConfigType config.WithValidation](
	ctx context.Context,
	serviceName,
	serviceVersion string,
	serviceConfig ConfigType,
	startFunction func(*Template[ConfigType]) error,
	logger log.Logger,
) *Template[ConfigType]

func (*Template[ConfigType]) AddCloseFunctions

func (t *Template[ConfigType]) AddCloseFunctions(closeFunctions ...callback.FunctionWithError)

func (*Template[ConfigType]) AddHealthcheckFunctions

func (t *Template[ConfigType]) AddHealthcheckFunctions(healthCheckFunctions ...callback.FunctionWithContextError)

func (*Template[ConfigType]) ConfigCopy

func (t *Template[ConfigType]) ConfigCopy() ConfigType

func (*Template[ConfigType]) Context

func (t *Template[ConfigType]) Context() context.Context

func (*Template[ConfigType]) HealthcheckFunctionsExecutor

func (t *Template[ConfigType]) HealthcheckFunctionsExecutor() func(context.Context) error

func (*Template[ConfigType]) Logger

func (t *Template[ConfigType]) Logger() log.Logger

func (*Template[ConfigType]) Meter

func (t *Template[ConfigType]) Meter() metrics.Meter

func (*Template[ConfigType]) Name

func (t *Template[ConfigType]) Name() string

func (*Template[ConfigType]) ReadConfig

func (t *Template[ConfigType]) ReadConfig(filepath string) error

func (*Template[ConfigType]) Run

func (t *Template[ConfigType]) Run() error

func (*Template[ConfigType]) Start

func (t *Template[ConfigType]) Start() error

func (*Template[ConfigType]) Stop

func (t *Template[ConfigType]) Stop() error

func (*Template[ConfigType]) Tracer

func (t *Template[ConfigType]) Tracer() tracing.Tracer

func (*Template[ConfigType]) Version

func (t *Template[ConfigType]) Version() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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