boot

package
v0.0.0-...-5886a04 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2025 License: MIT Imports: 11 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 Run

func Run[T any](ver string, conf *T, logConf *log.Options, builder func(*T) (*Application, error)) error

Types

type Application

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

func NewApplication

func NewApplication(tasks ...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 Task

type Task interface {
	Identifier() string
	Start(ctx context.Context) error
	Stop(ctx context.Context) error
}

Jump to

Keyboard shortcuts

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