boot

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultTimezone = "Asia/Shanghai"

Variables

This section is empty.

Functions

func DefaultConfigParser

func DefaultConfigParser[T any](ver string, parser func(string) (*T, error)) *T

func InitTimezone

func InitTimezone(zone string) error

func InitVersionPrinter

func InitVersionPrinter(printer func(string))

func Run

func Run[T any](conf *T, builder func(*T) (*Application, error), options ...Option) error

Types

type Application

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

func NewApplication

func NewApplication(tasks ...task.Task) *Application

func (*Application) Identifier

func (a *Application) Identifier() string

func (*Application) Start

func (a *Application) Start(ctx context.Context) error

func (*Application) Stop

func (a *Application) Stop(ctx context.Context) error

type Hook

type Hook = func(context.Context) error

type Option

type Option func(*options)

func AddAfterStop

func AddAfterStop(f Hook) Option

func AddBeforeStart

func AddBeforeStart(f Hook) Option

func AddBeforeStop

func AddBeforeStop(f Hook) Option

func WithLoggerInit

func WithLoggerInit(ver string, conf *log.Config) Option

func WithShutdownSignals

func WithShutdownSignals(sigs ...os.Signal) Option

func WithShutdownTimeout

func WithShutdownTimeout(d time.Duration) Option

Jump to

Keyboard shortcuts

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