Documentation
¶
Index ¶
- Constants
- type Application
- type IBundle
- type Option
- func OptionAfterStart(fn func(ctx context.Context) error) Option
- func OptionAfterStop(fn func(ctx context.Context) error) Option
- func OptionBeforeStart(fn func(ctx context.Context) error) Option
- func OptionBeforeStop(fn func(ctx context.Context) error) Option
- func OptionName(name string) Option
- func OptionSentryIncludePaths(paths ...string) Option
- func OptionStopTimeout(timeout time.Duration) Option
- func OptionWithLogger(logger logger.Logger) Option
- func OptionWithProfiler(profilePort int) Option
Constants ¶
View Source
const DefaultStopTimeout = time.Minute
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Application ¶
type Application interface { Name() string // 启动程序. 程序会在收到终止信号 或 所有任务执行完毕 或 context.Done() 时终止任务. // 终止信号: syscall.SIGTERM, syscall.SIGINT, syscall.SIGQUIT Run(context.Context) // 添加任务 AddBundle(...IBundle) }
func New ¶
func New(_opts ...Option) Application
type Option ¶
type Option func(*options)
func OptionName ¶
func OptionStopTimeout ¶
收到终止信号后, 如果任务无法正常结束时强制结束的时间.
func OptionWithLogger ¶
Click to show internal directories.
Click to hide internal directories.