Documentation
¶
Index ¶
Constants ¶
View Source
const BufferSize = 16 * 1024
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Settings ClientSettings Connected bool Connection Connection }
func CreateClient ¶
func CreateClient(settings ClientSettings) (*Client, error)
type ClientSettings ¶
type ClientSettings struct { Address string Timeout time.Duration Password string Listener ConnectionListener }
type Command ¶
func (*Command) GetExecute ¶
GetExecute formats a dialplan command to be sent over TCP Connection
type Connection ¶
type Connection struct { //server specific Server *Server //client specific Reconnects int ChannelData ESLkv Connected bool //generic Listener ConnectionListener // contains filtered or unexported fields }
func (*Connection) Close ¶
func (con *Connection) Close()
func (*Connection) Loop ¶
func (con *Connection) Loop()
type ConnectionListener ¶
type ConnectionListener interface { OnConnect(con *Connection) OnEvent(con *Connection, evt *Event) OnDisconnect(con *Connection, msg *Event) OnClose(con *Connection) }
type EventType ¶
type EventType int
EventType indicates how/why this event is being raised
const ( //Parser and Socket errors EventError EventType = iota //Client Mode: Connection established / terminated //Server Mode: New Connection / Lost Connection EventState //Library internal, used during auth phase EventAuth //Command Reply EventReply //API (reloadxml,reloadacl) commands EventApi //Received a disconnect notice (linger might still be on) EventDisconnect //Subscribed events EventGeneric )
type Server ¶
type Server struct { Settings ServerSettings NetListener net.Listener EvListener ServerListener }
func CreateServer ¶
func CreateServer(settings ServerSettings) (*Server, error)
type ServerListener ¶
type ServerListener interface {
OnNewConnection(con *Connection)
}
type ServerSettings ¶
type ServerSettings struct { Address string Listener ServerListener }
Click to show internal directories.
Click to hide internal directories.