Documentation ¶
Index ¶
- Constants
- func NewContext(ctx context.Context, a AppInfo) context.Context
- type App
- type AppInfo
- type Option
- func AfterStart(fn func(context.Context) error) Option
- func AfterStop(fn func(context.Context) error) Option
- func BeforeStart(fn func(context.Context) error) Option
- func BeforeStop(fn func(context.Context) error) Option
- func Context(ctx context.Context) Option
- func ID(id string) Option
- func Logger(logger glog.Logger) Option
- func Name(name string) Option
- func Server(srv ...server.Server) Option
- func Signal(signals ...os.Signal) Option
- func StopTimeout(t time.Duration) Option
- func Version(version string) Option
Constants ¶
View Source
const Release = "v1.2.2"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Option ¶
type Option func(o *option)
Option 定义一个应用程序选项类型。
func AfterStart ¶ added in v1.2.2
AfterStart 应用启动后执行此 funcs。
func BeforeStart ¶ added in v1.2.2
BeforeStart 应用启动前执行此 funcs。
func BeforeStop ¶ added in v1.2.2
BeforeStop 应用停止前执行此 funcs。
Click to show internal directories.
Click to hide internal directories.