Documentation
¶
Index ¶
- Constants
- func NewLogger(level int, prefix string, flags int) *logger
- 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) ErrorInterface
- type ErrorInterface
Constants ¶
View Source
const ( ArgumentTypeString = "string" ArgumentTypeInt = "int" ApplicationTypeWeb = "web" ApplicationTypeScript = "script" ApplicationTypeConsumer = "consumer" )
View Source
const ( LogLevelDebug = 1 << iota LogLevelInfo LogLevelWarn LogLevelErr )
Variables ¶
This section is empty.
Functions ¶
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) ErrorInterface
// 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) ErrorInterface
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 ErrorInterface ¶
type ErrorInterface interface {
Error() string
GetCode() int
GetStack() []byte
GetDetails() []ApplicationErrorDetail
AddDetail(message string, code int) ErrorInterface
}
Common Error Interface
func NewErrorF ¶
func NewErrorF(message string, code int, args ...interface{}) ErrorInterface
New error
Click to show internal directories.
Click to hide internal directories.