Documentation
¶
Index ¶
- Constants
- func NewMiddlewareCollection(config Config, app Application, maxLogBodySize int64) *middlewareCollection
- type App
- func (a App) FatalError(err error)
- func (a App) GetAbsolutePath(path string, dir string) (string, goerr.IError)
- func (a App) GetConfig() interface{}
- func (a App) GetConfigPath(env string) string
- func (a *App) GetLogger(level int) Logger
- func (a *App) ParseConfig(env string) Application
- func (a App) ParseFlags(args *Arguments)
- func (a *App) SetConfig(cfg interface{}) Application
- func (a App) Start(port string, callback func(command Command)) goerr.IError
- type Application
- type Argument
- type Arguments
- type BindingIdentifier
- type Command
- type Config
- type ConnectionBindings
- func (cb *ConnectionBindings) Bind(bId BindingIdentifier, id ConnectionIdentifier) *ConnectionBindings
- func (cb *ConnectionBindings) GetBindingId(id ConnectionIdentifier) BindingIdentifier
- func (cb *ConnectionBindings) GetConnectionId(bId BindingIdentifier) ConnectionIdentifier
- func (cb *ConnectionBindings) UnBind(bId BindingIdentifier, id ConnectionIdentifier) *ConnectionBindings
- type ConnectionEvent
- type ConnectionEventListeners
- func (cel *ConnectionEventListeners) Dispatch(id ConnectionIdentifier, name ConnectionEventName) *ConnectionEventListeners
- func (cel *ConnectionEventListeners) Get(id ConnectionIdentifier) []ConnectionEvent
- func (cel *ConnectionEventListeners) Register(id ConnectionIdentifier, name ConnectionEventName) chan bool
- func (cel *ConnectionEventListeners) Unregister(id ConnectionIdentifier, name ConnectionEventName) *ConnectionEventListeners
- func (cel *ConnectionEventListeners) UnregisterConnection(id ConnectionIdentifier) *ConnectionEventListeners
- type ConnectionEventName
- type ConnectionIdentifier
- type Connections
- type Logger
- type WebApp
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 ¶
func NewMiddlewareCollection ¶
func NewMiddlewareCollection(config Config, app Application, maxLogBodySize int64) *middlewareCollection
New Middleware Collection Init Method
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
func (App) GetAbsolutePath ¶
Get absolute path to application
type Application ¶
type Application interface {
// Get config struct
GetConfig() interface{}
// Get full path to config
GetConfigPath(env string) string
// Get absolute path
GetAbsolutePath(path string, dir string) (string, goerr.IError)
// Set config struct
SetConfig(cfg interface{}) Application
// Parse config
ParseConfig(env string) Application
// Start application
Start(port string, callback func(command Command)) goerr.IError
// Behaviour for fatal errors
FatalError(err error)
// Get Logger
GetLogger(level int) Logger
// Parse console flags
ParseFlags(args *Arguments)
}
Application class
func NewStdApplication ¶
func NewStdApplication(env string, configPath string, values interface{}) Application
type BindingIdentifier ¶
type BindingIdentifier interface{}
type Command ¶
type Command struct {
// contains filtered or unexported fields
}
Command is an argument list
func (*Command) BindConnection ¶
Bind connection to command
type ConnectionBindings ¶
type ConnectionBindings struct {
// contains filtered or unexported fields
}
func NewConnectionBindings ¶
func NewConnectionBindings() *ConnectionBindings
func (*ConnectionBindings) Bind ¶
func (cb *ConnectionBindings) Bind(bId BindingIdentifier, id ConnectionIdentifier) *ConnectionBindings
func (*ConnectionBindings) GetBindingId ¶
func (cb *ConnectionBindings) GetBindingId(id ConnectionIdentifier) BindingIdentifier
func (*ConnectionBindings) GetConnectionId ¶
func (cb *ConnectionBindings) GetConnectionId(bId BindingIdentifier) ConnectionIdentifier
func (*ConnectionBindings) UnBind ¶
func (cb *ConnectionBindings) UnBind(bId BindingIdentifier, id ConnectionIdentifier) *ConnectionBindings
type ConnectionEvent ¶
type ConnectionEvent struct {
Name ConnectionEventName
Done chan bool
}
type ConnectionEventListeners ¶
type ConnectionEventListeners struct {
// contains filtered or unexported fields
}
func NewConnectionEventListeners ¶
func NewConnectionEventListeners() *ConnectionEventListeners
New Connection event Listener
func (*ConnectionEventListeners) Dispatch ¶
func (cel *ConnectionEventListeners) Dispatch(id ConnectionIdentifier, name ConnectionEventName) *ConnectionEventListeners
Dispatch event
func (*ConnectionEventListeners) Get ¶
func (cel *ConnectionEventListeners) Get(id ConnectionIdentifier) []ConnectionEvent
Get events
func (*ConnectionEventListeners) Register ¶
func (cel *ConnectionEventListeners) Register(id ConnectionIdentifier, name ConnectionEventName) chan bool
Register connection listener
func (*ConnectionEventListeners) Unregister ¶
func (cel *ConnectionEventListeners) Unregister(id ConnectionIdentifier, name ConnectionEventName) *ConnectionEventListeners
Unregister connection event listener
func (*ConnectionEventListeners) UnregisterConnection ¶
func (cel *ConnectionEventListeners) UnregisterConnection(id ConnectionIdentifier) *ConnectionEventListeners
Unregister connection listener
type ConnectionEventName ¶
type ConnectionEventName string
type ConnectionIdentifier ¶
type ConnectionIdentifier string
type Connections ¶
type Connections struct {
// contains filtered or unexported fields
}
func (*Connections) Get ¶
func (cs *Connections) Get(id ConnectionIdentifier) net.Conn
Get connection if exists
func (*Connections) Set ¶
func (cs *Connections) Set(id ConnectionIdentifier, conn net.Conn) *Connections
Set connection
func (*Connections) Unset ¶
func (cs *Connections) Unset(id ConnectionIdentifier) *Connections
Unset connection if exists
type Logger ¶
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.