Documentation ¶
Index ¶
Constants ¶
View Source
const ( // Env EnvLocal = 0 // 本地 EnvDebug = 1 // 测试 EnvPrev = 2 // 预发布 EnvProd = 3 // 线上 CliAppEnv = "app-env" CliAppVer = "app-version" CliAppLogMore = "app-log-more" )
View Source
const ( CliAppCmd = "path" CliAppCmdArg = "args" )
View Source
const ( CliWebIP = "web-ip" CliWebPort = "web-port" )
Variables ¶
View Source
var (
AppCmdNoFind = errors.New(" Command No Find")
)
View Source
var (
EnvVersion = "1.0.0"
)
Functions ¶
This section is empty.
Types ¶
type Application ¶
type Application struct { Component map[string]Component Log logger.Interface Cfg AppConfig Ser Service }
func (*Application) Start ¶
func (app *Application) Start(cmd *cli.App, args []string, service Service)
type BasicService ¶
type BasicService struct {
RunBefore, InitBefore func() error
}
func (*BasicService) ParserFile ¶
func (c *BasicService) ParserFile(cfg interface{}) error
type CmdService ¶
type CmdService struct { BasicService Cfg struct { RunMode string `yaml:"runmode"` // 服务运行模式 } Router map[string]CmdHandle // contains filtered or unexported fields }
func (*CmdService) AddCmdHandle ¶
func (c *CmdService) AddCmdHandle(name string, handle CmdHandle) *CmdService
func (*CmdService) CliFlags ¶
func (c *CmdService) CliFlags() []cli.Flag
func (*CmdService) Close ¶
func (c *CmdService) Close()
type WebService ¶ added in v0.2.6
type WebService struct { BasicService Cfg struct { IP string `yaml:"ip"` // 监听端口 Port int `yaml:"listen"` // 监听端口 RunMode string `yaml:"runmode"` // 服务运行模式 } Handler http.Handler }
func (*WebService) CliFlags ¶ added in v0.2.6
func (c *WebService) CliFlags() []cli.Flag
func (*WebService) Close ¶ added in v0.2.6
func (c *WebService) Close()
Click to show internal directories.
Click to hide internal directories.