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.2.0
type CmdService ¶ added in v0.2.2
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.2.2
func (c *CmdService) AddCmdFunc(name string, handle func(logger.Interface) error) *CmdService
func (*CmdService) AddCmdHandle ¶ added in v0.2.2
func (c *CmdService) AddCmdHandle(name string, handle CmdHandle) *CmdService
func (*CmdService) CliFlags ¶ added in v0.2.2
func (c *CmdService) CliFlags() []cli.Flag
func (*CmdService) Close ¶ added in v0.2.2
func (c *CmdService) Close()
type Component ¶
type Component interface {
CliFlags() []cli.Flag
Init(env int, logMore bool, ctx *cli.Context, infoLog, warnLog, errLog func(string, ...interface{})) error
Run(env int, logMore bool, infoLog, warnLog, errLog func(string, ...interface{})) error
Close(env int, logMore bool, infoLog, warnLog, errLog func(string, ...interface{})) error
}
type WebService ¶
type WebService struct {
Handle http.Handler
BeforeRun, BeforeInit func(l logger.Interface) error
// contains filtered or unexported fields
}
func (*WebService) CliFlags ¶ added in v0.2.2
func (c *WebService) CliFlags() []cli.Flag
func (*WebService) Close ¶ added in v0.2.2
func (c *WebService) Close()
Click to show internal directories.
Click to hide internal directories.