Documentation
¶
Index ¶
- Constants
- Variables
- func IsDecodingError(err error) bool
- func LogLevelToString(l LogLevel) string
- type AvayaError
- type Client
- func (c *Client) AttachJob(ctx context.Context, jobName string) error
- func (c *Client) AvailWork(ctx context.Context) error
- func (c *Client) ConnectHeadset(ctx context.Context) error
- func (c *Client) DetachJob(ctx context.Context) error
- func (c *Client) DisconnectHeadset(ctx context.Context) error
- func (c *Client) EchoOff(ctx context.Context) error
- func (c *Client) EchoOn(ctx context.Context) error
- func (c *Client) FinishedItem(ctx context.Context, compCode int) error
- func (c *Client) FreeHeadset(ctx context.Context) error
- func (c *Client) ListCallFields(ctx context.Context, listName string) ([]string, error)
- func (c *Client) ListCallLists(ctx context.Context) ([]string, error)
- func (c *Client) ListDataFields(ctx context.Context, listType ListType) ([]DataField, error)
- func (c *Client) ListJobs(ctx context.Context, jobType JobType) ([]Job, error)
- func (c *Client) ListKeys(ctx context.Context) ([]string, error)
- func (c *Client) ListState(ctx context.Context) (*State, error)
- func (c *Client) LogIoStart(ctx context.Context) error
- func (c *Client) LogIoStop(ctx context.Context) error
- func (c *Client) Logoff(ctx context.Context) error
- func (c *Client) Logon(ctx context.Context, agentName string, password string) error
- func (c *Client) NoFurtherWork(ctx context.Context) error
- func (c *Client) Notifications(ctx context.Context) <-chan Notification
- func (c *Client) ReadField(ctx context.Context, listType ListType, fieldName string) (*Field, error)
- func (c *Client) ReadyNextItem(ctx context.Context) error
- func (c *Client) ReleaseLine(ctx context.Context) error
- func (c *Client) ReserveHeadset(ctx context.Context, headsetID int) error
- func (c *Client) SetDataField(ctx context.Context, listType ListType, fieldName string) error
- func (c *Client) SetNotifyKeyField(ctx context.Context, listType ListType, fieldName string) error
- func (c *Client) Start() error
- type DataField
- type Event
- func (e Event) IsDataMessage() bool
- func (e Event) IsNotificationData() bool
- func (e Event) IsNotificationError() bool
- func (e Event) IsPending() bool
- func (e Event) IsResponseError() bool
- func (e Event) IsStart() bool
- func (e Event) IsSuccessfulNotification() bool
- func (e Event) IsSuccessfulResponse() bool
- type EventType
- type Field
- type FieldType
- type Job
- type JobType
- type ListType
- type LogEntry
- type LogHandler
- type LogLevel
- type Notification
- type NotificationType
- type Option
- type Options
- type State
- type StateType
- type StatusType
Constants ¶
const ( // ConnOK means that connection is currently online ConnOK uint32 = iota // ConnClosed means that connection is currently closing or already closed ConnClosed )
const ( // RS is Message separator RS byte = 0x1E // ETB is IsIncomplete message separator ETB byte = 0x17 // ETX is End of text ETX byte = 0x03 )
Variables ¶
var ( ErrConnectionClosed = errors.New("connection closed") ErrHelloNotReceived = errors.New("hello not received") )
Functions ¶
func IsDecodingError ¶
func LogLevelToString ¶
LogLevelToString transforms Level to its string representation.
Types ¶
type AvayaError ¶
type AvayaError struct {
Code string
}
func (AvayaError) Error ¶
func (e AvayaError) Error() string
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
NewClient returns Avaya Proactive Client Agent API client to work with. Client keeps alive underlying connection, because APC proto is stateful.
func (*Client) FinishedItem ¶
func (*Client) ListCallFields ¶
func (*Client) ListCallLists ¶
func (*Client) ListDataFields ¶
func (*Client) Logoff ¶
Logoff sends ATGLogoff command, then Proactive Control server terminates session
func (*Client) Notifications ¶
func (c *Client) Notifications(ctx context.Context) <-chan Notification
Notifications returns read-only notification event channel.
func (*Client) ReserveHeadset ¶
func (*Client) SetDataField ¶
func (*Client) SetNotifyKeyField ¶
type Event ¶
type Event struct { Keyword string Type EventType Client string ProcessID uint32 InvokeID uint32 Segments []string IsIncomplete bool }
func (Event) IsDataMessage ¶
func (Event) IsNotificationData ¶
func (Event) IsNotificationError ¶
func (Event) IsResponseError ¶
func (Event) IsSuccessfulNotification ¶
func (Event) IsSuccessfulResponse ¶
type Job ¶
type Job struct { Type JobType Name string Status StatusType }
type LogHandler ¶
type LogHandler func(LogEntry)
LogHandler handles log entries - i.e. writes into correct destination if necessary.
type LogLevel ¶
type LogLevel int
LogLevel describes the chosen log level.
const ( // LogLevelNone means no logging. LogLevelNone LogLevel = iota // LogLevelDebug turns on debug logs - its generally too much for production in normal // conditions but can help when developing and investigating problems in production. LogLevelDebug // LogLevelInfo is logs useful server information. This includes various information // about problems with client connections which is not Centrifugo errors but // in most situations malformed client behaviour. LogLevelInfo // LogLevelError level logs only server errors. This is logging that means non-working // Centrifugo and maybe effort from developers/administrators to make things // work again. LogLevelError )
type Notification ¶
type Notification struct { Type NotificationType Payload interface{} }
type NotificationType ¶
type NotificationType string
const ( NotificationTypeCallNotify NotificationType = "AGTCallNotify" NotificationTypeAutoReleaseLine NotificationType = "AGTAutoReleaseLine" NotificationTypeJobEnd NotificationType = "AGTJobEnd" NotificationTypeReceiveMessage NotificationType = "AGTReceiveMessage" NotificationTypeJobTransRequest NotificationType = "AGTJobTransRequest" NotificationTypeHeadsetConnBroken NotificationType = "AGTHeadsetConnBroken" NotificationTypeSystemError NotificationType = "AGTSystemError" )
type Option ¶
type Option func(*Options)
func WithDecoder ¶
WithDecoder returns an Option with custom decoder e.g w/ charmap.Windows1251.NewDecoder().
func WithLogHandler ¶
func WithLogHandler(logLevel LogLevel, handler LogHandler) Option
WithLogHandler returns an Option with custom log handler.
func WithTimeout ¶
WithTimeout returns an Option with Timeout for underlying Client connection.
func WithTlsPatched ¶
func WithTlsPatched() Option
WithTlsPatched returns an Option with patched TLS package to fix issues with old TLS 1.0 only Avaya server
func WithTlsSkipVerify ¶
func WithTlsSkipVerify() Option
WithTlsSkipVerify returns an Option with flag to skip TLS verification (insecure!)
type StatusType ¶
type StatusType byte
const ( StatusTypeInactive StatusType = 'I' StatusTypeActive StatusType = 'A' )