Documentation ¶
Index ¶
- type KamEvapi
- func (kea *KamEvapi) Connect() error
- func (kea *KamEvapi) Connected() bool
- func (kea *KamEvapi) Disconnect() (err error)
- func (kea *KamEvapi) ReadEvents() (err error)
- func (kea *KamEvapi) ReconnectIfNeeded() error
- func (kea *KamEvapi) RemoteAddr() net.Addr
- func (kea *KamEvapi) Send(dataStr string) error
- type KamEvapiPool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KamEvapi ¶
type KamEvapi struct {
// contains filtered or unexported fields
}
func NewKamEvapi ¶
func NewKamEvapi(addr string, connIdx int, recons int, maxReconnectInterval time.Duration, delayFunc func(time.Duration, time.Duration) func() time.Duration, eventHandlers map[*regexp.Regexp][]func([]byte, int), logger *log.Logger) (*KamEvapi, error)
NewKamEvapi creates a new kamEvApi, connects it and in case forkRead is enabled starts listening in background
func (*KamEvapi) Disconnect ¶
Disconnect disconnects from socket
func (*KamEvapi) ReadEvents ¶
ReadEvents reads events from socket, attempt reconnect if disconnected
func (*KamEvapi) ReconnectIfNeeded ¶
ReconnectIfNeeded if not connected, attempt reconnect if allowed
func (*KamEvapi) RemoteAddr ¶
RemoteAddr returns the connection address if is connected
type KamEvapiPool ¶
type KamEvapiPool struct {
// contains filtered or unexported fields
}
Connection handler for commands sent to FreeSWITCH
func NewKamEvapiPool ¶
func NewKamEvapiPool(maxconns int, kamAddr string, connIdx, reconnects int, maxReconnectInterval time.Duration, delayFuncConstructor func(time.Duration, time.Duration) func() time.Duration, l *log.Logger) (*KamEvapiPool, error)
Instantiates a new KamEvapiPool
func (*KamEvapiPool) PopKamEvapi ¶
func (keap *KamEvapiPool) PopKamEvapi() (*KamEvapi, error)
Retrieves a connection from the pool
func (*KamEvapiPool) PushKamEvapi ¶
func (keap *KamEvapiPool) PushKamEvapi(kea *KamEvapi)
Push the connection back to the pool
Click to show internal directories.
Click to hide internal directories.