Documentation
¶
Index ¶
- func AddServer(s server.Server)
- func AddWorker(w worker.Worker)
- func GracefulStop(ctx context.Context) (err error)
- func Init(baseConfig LoadBaseConfigFunction) (err error)
- func RegisterHooks(k Stage, fns ...func() error) error
- func Run()
- func Stop() (err error)
- type Application
- type BaseConfig
- type LoadBaseConfigFunction
- type Stage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GracefulStop ¶
GracefulStop application after necessary cleanup
func Init ¶
func Init(baseConfig LoadBaseConfigFunction) (err error)
func RegisterHooks ¶
RegisterHooks register a stage Hook
Types ¶
type Application ¶
type Application struct {
// contains filtered or unexported fields
}
type BaseConfig ¶
type BaseConfig struct { // 日志路径,为空终端打印 LogPath string // 配置源:nacos/file ConfigSource string // 配置路径: // file: 文件地址 // nacos: host+port,无http前缀 ConfigPath string // 是否watch EnableWatch bool // etcd的目录 PropertyKey string // 用户名 Username string // 密码 Password string // nacos data_id DataID string // nacos group Group string // nacos config type Suffix string // nacos namespaceID NamespaceID string }
type LoadBaseConfigFunction ¶
type LoadBaseConfigFunction func()
func LoadWithFlags ¶
func LoadWithFlags() LoadBaseConfigFunction
func LoadWithInput ¶
func LoadWithInput(b *BaseConfig) LoadBaseConfigFunction
Click to show internal directories.
Click to hide internal directories.