Documentation
¶
Index ¶
- Constants
- type Application
- type Argument
- type Arguments
- type Command
- type DNApp
- func (a DNApp) FatalError(err error)
- func (a DNApp) GetConfig() interface{}
- func (a DNApp) GetConfigPath(env string) string
- func (a DNApp) GetLogger(level int) Logger
- func (a DNApp) New(env string, config interface{}) Application
- func (a DNApp) ParseFlags(args *Arguments)
- func (a DNApp) SetConfig(cfg interface{}) Application
- func (a DNApp) Start(port string, callback func(command Command)) porterr.IError
- type Logger
Constants ¶
View Source
const ( ArgumentTypeString = "string" ArgumentTypeInt = "int" ArgumentTypeUint = "uint" ArgumentTypeBool = "bool" )
View Source
const ( CommandPrefix = "-" CommandAssignee = "=" )
View Source
const ( LogLevelDebug = 1 << iota LogLevelInfo LogLevelWarn LogLevelErr )
View Source
const ( CommandSessionHost = "localhost" CommandSessionType = "tcp" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Application ¶
type Application interface {
// Get config struct
GetConfig() interface{}
// Get full path to config
GetConfigPath(env string) string
// Set config struct
SetConfig(cfg interface{}) Application
// Start application
Start(port string, callback func(command Command)) porterr.IError
// Init app method
New(env string, cfg interface{}) Application
// Behaviour for fatal errors
FatalError(err error)
// Get Logger
GetLogger(level int) Logger
// Parse console flags
ParseFlags(args *Arguments)
}
Application class
type Argument ¶
Argument
type Command ¶ added in v0.4.0
type Command struct {
// contains filtered or unexported fields
}
Command is an argument list
func (*Command) BindConnection ¶ added in v0.4.0
Bind connection to command
func (*Command) UnbindConnection ¶ added in v0.4.0
func (c *Command) UnbindConnection()
UnBind connection
type DNApp ¶
type DNApp struct {
ConfigPath string
// contains filtered or unexported fields
}
Dynamic Name Application
func (DNApp) GetConfigPath ¶
Get full path to config
type Logger ¶ added in v0.0.7
type Logger interface {
GetLevel() int
Print(v ...interface{})
Println(v ...interface{})
Printf(format string, v ...interface{})
Info(v ...interface{})
Infoln(v ...interface{})
Infof(format string, v ...interface{})
Warn(v ...interface{})
Warnln(v ...interface{})
Warnf(format string, v ...interface{})
Error(v ...interface{})
Errorln(v ...interface{})
Errorf(format string, v ...interface{})
}
Click to show internal directories.
Click to hide internal directories.