Documentation
¶
Index ¶
- Constants
- Variables
- func DecomposeCommand(command *gocli.Command) (action string, arguments []gocli.Argument, e porterr.IError)
- func NewMiddlewareCollection(config Config, app gocli.Application, maxLogBodySize int64) *middlewareCollection
- type Application
- type BindingIdentifier
- type Config
- type ConnectionBindings
- func (cb *ConnectionBindings) Bind(bId BindingIdentifier, id ConnectionIdentifier) *ConnectionBindings
- func (cb *ConnectionBindings) GetBindingId(id ConnectionIdentifier) BindingIdentifier
- func (cb *ConnectionBindings) GetBindingIdentifiers() []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
- func (cs *Connections) Get(id ConnectionIdentifier) net.Conn
- func (cs *Connections) GetIdentifiers() []ConnectionIdentifier
- func (cs *Connections) Len() int
- func (cs *Connections) Set(id ConnectionIdentifier, conn net.Conn) *Connections
- func (cs *Connections) Unset(id ConnectionIdentifier) *Connections
Constants ¶
View Source
const ( CommandStart = "start" CommandStop = "stop" CommandRestart = "restart" CommandStatus = "status" CommandWeb = "web" )
Variables ¶
View Source
var CommandActions = []string{ CommandStart, CommandStop, CommandRestart, CommandStatus, }
Functions ¶
func DecomposeCommand ¶ added in v1.2.0
func DecomposeCommand(command *gocli.Command) (action string, arguments []gocli.Argument, e porterr.IError)
Parse gocli.Command
func NewMiddlewareCollection ¶
func NewMiddlewareCollection(config Config, app gocli.Application, maxLogBodySize int64) *middlewareCollection
New Middleware Collection Init Method
Types ¶
type Application ¶
type Application struct {
// The console application base interface.
// Required for start
gocli.Application
// contains filtered or unexported fields
}
Web Application
func NewApplication ¶
func NewApplication(config Config, app gocli.Application, connState func(net.Conn, http.ConnState)) *Application
Init Web Application
func (*Application) Listen ¶
func (a *Application) Listen(routes http.Handler)
Make server and listen
func (*Application) WebCommander ¶ added in v1.2.0
func (a *Application) WebCommander(command *gocli.Command)
Web command processor
type Config ¶
type Config struct {
// Web application port
Port int
// Web application server host
Host string
// Web application url. For logging
Url string
// Server timeouts
Timeout struct {
// Timeout read
Read int
// Timeout write
Write int
// Timeout idle
Idle int
}
}
Web config
type ConnectionBindings ¶
type ConnectionBindings struct {
// contains filtered or unexported fields
}
Bindings
func (*ConnectionBindings) Bind ¶
func (cb *ConnectionBindings) Bind(bId BindingIdentifier, id ConnectionIdentifier) *ConnectionBindings
Associate connection with id
func (*ConnectionBindings) GetBindingId ¶
func (cb *ConnectionBindings) GetBindingId(id ConnectionIdentifier) BindingIdentifier
Get participantId by connection id
func (*ConnectionBindings) GetBindingIdentifiers ¶ added in v1.2.2
func (cb *ConnectionBindings) GetBindingIdentifiers() []BindingIdentifier
Get all bindings identifiers
func (*ConnectionBindings) GetConnectionId ¶
func (cb *ConnectionBindings) GetConnectionId(bId BindingIdentifier) ConnectionIdentifier
Get connection Id by id
func (*ConnectionBindings) UnBind ¶
func (cb *ConnectionBindings) UnBind(bId BindingIdentifier, id ConnectionIdentifier) *ConnectionBindings
Unbind connection with id
type ConnectionEvent ¶
type ConnectionEvent struct {
// Name of the event
Name ConnectionEventName
// Mark when event happens
Done chan bool
}
Events that can be
type ConnectionEventListeners ¶
type ConnectionEventListeners struct {
// contains filtered or unexported fields
}
Listeners struct
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 Connections ¶
type Connections struct {
// contains filtered or unexported fields
}
Connections
func (*Connections) Get ¶
func (cs *Connections) Get(id ConnectionIdentifier) net.Conn
Get connection if exists
func (*Connections) GetIdentifiers ¶ added in v1.2.1
func (cs *Connections) GetIdentifiers() []ConnectionIdentifier
Get all identifiers
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
Click to show internal directories.
Click to hide internal directories.