Documentation ¶
Index ¶
- Constants
- Variables
- type Application
- type CmdArg
- type CmdHandle
- type CmdService
- func (c *CmdService) AddCmdFunc(name string, handle func(logger.Interface) error) *CmdService
- func (c *CmdService) AddCmdHandle(name string, handle CmdHandle) *CmdService
- func (c *CmdService) CliFlags() []cli.Flag
- func (c *CmdService) Close()
- func (c *CmdService) Init(cfg *Config, _ *cli.Context) (logger.Interface, error)
- func (c *CmdService) Run(l logger.Interface, _ *Config) error
- type Component
- type Config
- type Service
- type WebConfig
- type WebService
Constants ¶
View Source
const ( EnvLocal = 0 // 本地 EnvTest = 1 // 测试 EnvPrev = 2 // 预发布 EnvRelease = 3 // 线上 CliAppEnv = "app-env" CliAppVer = "app-version" CliAppLogMore = "app-log-more" InvalidPath = "__invalid__" )
View Source
const ( CliWebIP = "web-ip" CliWebPort = "web-port" CliWebReadTimeout = "web-r-timeout" CliWebWriteTimeout = "web-w-timeout" CliWebIdleTimeout = "web-idle-timeout" )
Variables ¶
View Source
var ( EnvVersion = "1.0.0" EnvLocalArg = "local" // 本地 EnvTestArg = "test" // 测试 EnvPrevArg = "preview" // 预发布 EnvReleaseArg = "release" // 线上 )
View Source
var (
CmdNoFind = errors.New(" Command No Find")
)
Functions ¶
This section is empty.
Types ¶
type Application ¶ added in v0.5.0
type Application struct { Component map[string]Component Log logger.Interface Cfg Config Ser Service }
func (*Application) Start ¶ added in v0.5.0
func (app *Application) Start(cmd *cli.App, args []string, service Service)
type CmdService ¶ added in v0.5.0
type CmdService struct { Router map[string]CmdHandle BeforeRun, BeforeInit func(l logger.Interface) error // contains filtered or unexported fields }
func (*CmdService) AddCmdFunc ¶ added in v0.5.0
func (c *CmdService) AddCmdFunc(name string, handle func(logger.Interface) error) *CmdService
func (*CmdService) AddCmdHandle ¶ added in v0.5.0
func (c *CmdService) AddCmdHandle(name string, handle CmdHandle) *CmdService
func (*CmdService) CliFlags ¶ added in v0.5.0
func (c *CmdService) CliFlags() []cli.Flag
func (*CmdService) Close ¶ added in v0.5.0
func (c *CmdService) Close()
type WebService ¶ added in v0.5.0
type WebService struct { Cfg WebConfig Handler http.Handler BeforeRun, BeforeInit func(l logger.Interface) error }
func (*WebService) CliFlags ¶ added in v0.5.0
func (c *WebService) CliFlags() []cli.Flag
func (*WebService) Close ¶ added in v0.5.0
func (c *WebService) Close()
Click to show internal directories.
Click to hide internal directories.