Documentation
¶
Index ¶
- 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) 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
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMiddlewareCollection ¶
func NewMiddlewareCollection(config Config, app gocli.Application, maxLogBodySize int64) *middlewareCollection
New Middleware Collection Init Method
Types ¶
type Application ¶
type Application struct {
// 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
type Config ¶
type Config struct {
Port int
Host string
Url string
Timeout struct {
Read int
Write int
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) 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 ConnectionEventName
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) 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.