Documentation
¶
Index ¶
- Constants
- type Application
- type ApplicationError
- type ApplicationErrorDetail
- type Argument
- type Arguments
- 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(arguments Arguments) IError
- type IError
- type Logger
Constants ¶
View Source
const ( ArgumentTypeString = "string" ArgumentTypeInt = "int" )
View Source
const ( LogLevelDebug = 1 << iota LogLevelInfo LogLevelWarn LogLevelErr )
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(arguments Arguments) 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 ApplicationError ¶
type ApplicationError struct {
// contains filtered or unexported fields
}
Application Error
func (ApplicationError) AddDetail ¶
func (ae ApplicationError) AddDetail(message string, code int) IError
Interface app error add detail
func (ApplicationError) GetCode ¶
func (ae ApplicationError) GetCode() int
Interface app error get code
func (ApplicationError) GetDetails ¶
func (ae ApplicationError) GetDetails() []ApplicationErrorDetail
Interface app error get details
func (ApplicationError) GetStack ¶
func (ae ApplicationError) GetStack() []byte
Interface app error get stack
type ApplicationErrorDetail ¶
Detailed error
type DNApp ¶
type DNApp struct {
// contains filtered or unexported fields
}
Dynamic Name Application
func (DNApp) GetConfigPath ¶
Get full path to config
type IError ¶ added in v0.0.6
type IError interface {
Error() string
GetCode() int
GetStack() []byte
GetDetails() []ApplicationErrorDetail
AddDetail(message string, code int) IError
}
Common Error Interface
type Logger ¶ added in v0.0.7
type Logger interface {
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.