Documentation ¶
Index ¶
- type Client
- func (c Client) AbandonQueue(ctx context.Context, sessionKey string, contactID int64, reason string) error
- func (c Client) AnonymousLogin(ctx context.Context) (string, int64, error)
- func (c Client) CustomerID(ctx context.Context, sessionID string, anonymousID int64, email string) (int64, error)
- func (c Client) EndSession(ctx context.Context, sessionKey string, contactID int64) error
- func (c Client) IsSkillsetInService(ctx context.Context, skillsetName string) (bool, error)
- func (c Client) KeepAlive(ctx context.Context, sessionID string, contactID int64, isTyping bool) error
- func (c Client) ReadMessages(ctx context.Context, sessionKey string, contactID int64, isWriting bool, ...) (*CIWebCommsWs.CIMultipleChatMessageReadType, error)
- func (c Client) RequestChat(ctx context.Context, customerID int64, sessionID string, skillsetID int64) (int64, error)
- func (c Client) Skillset(ctx context.Context, sessionID, name string) (*Skillset, error)
- func (c Client) WriteMessage(ctx context.Context, sessionKey string, contactID int64, message string, ...) error
- type Conversation
- type DirectConversation
- func (c *DirectConversation) Close(ctx context.Context) error
- func (c *DirectConversation) CustomerID() int64
- func (c *DirectConversation) IsAnswered() bool
- func (c *DirectConversation) IsClosed() bool
- func (c *DirectConversation) Keepalive(ctx context.Context, isTyping bool) error
- func (c *DirectConversation) Name() string
- func (c *DirectConversation) ReadMessages(ctx context.Context) ([]Message, bool, error)
- func (c *DirectConversation) SetVerbose(verbose bool)
- func (c *DirectConversation) WriteMessage(ctx context.Context, message string) error
- type Message
- type Skillset
- type Throttle
- type ThrottledConversation
- func (tc *ThrottledConversation) Close(ctx context.Context) error
- func (tc *ThrottledConversation) IsAnswered() bool
- func (tc *ThrottledConversation) IsClosed() bool
- func (tc *ThrottledConversation) Keepalive(ctx context.Context, isTyping bool) error
- func (tc *ThrottledConversation) Name() string
- func (tc *ThrottledConversation) ReadMessages(ctx context.Context) ([]Message, bool, error)
- func (tc *ThrottledConversation) SetVerbose(v bool)
- func (tc *ThrottledConversation) WriteMessage(ctx context.Context, message string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Verbose bool // contains filtered or unexported fields }
Client - Avaya chat SOAP client
func (Client) AbandonQueue ¶
func (c Client) AbandonQueue(ctx context.Context, sessionKey string, contactID int64, reason string) error
AbandonQueue - remove a session from the AACC chat queue
func (Client) AnonymousLogin ¶
AnonymousLogin - login to the AACC server
func (Client) CustomerID ¶
func (c Client) CustomerID(ctx context.Context, sessionID string, anonymousID int64, email string) (int64, error)
CustomerID - Get a customer ID for a given session
func (Client) EndSession ¶
EndSession - stop the conversation
func (Client) IsSkillsetInService ¶
IsSkillsetInService - establish if a give n skillset is in use, e.g. an advisor is logged in
func (Client) KeepAlive ¶
func (c Client) KeepAlive(ctx context.Context, sessionID string, contactID int64, isTyping bool) error
KeepAlive - send a keepalive messsage to the AACC server
func (Client) ReadMessages ¶
func (c Client) ReadMessages(ctx context.Context, sessionKey string, contactID int64, isWriting bool, lastReadTime int64) (*CIWebCommsWs.CIMultipleChatMessageReadType, error)
ReadMessages - read unread messages from the AACC server
func (Client) RequestChat ¶
func (c Client) RequestChat(ctx context.Context, customerID int64, sessionID string, skillsetID int64) (int64, error)
RequestChat - start a conversation
func (Client) WriteMessage ¶
func (c Client) WriteMessage(ctx context.Context, sessionKey string, contactID int64, message string, msgType CIWebCommsWs.CIChatMessageType) error
WriteMessage - send a message to the AACC server
type Conversation ¶
type Conversation interface { Keepalive(ctx context.Context, isTyping bool) error WriteMessage(context.Context, string) error ReadMessages(context.Context) (messages []Message, advisorTyping bool, err error) Close(context.Context) error IsAnswered() bool IsClosed() bool Name() string SetVerbose(bool) }
Conversation - an avaya conversation
func NewDirectConversation ¶
func NewDirectConversation(ctx context.Context, c Client, name, email, skillsetName string) (Conversation, error)
NewDirectConversation - Creates a new Conversation
type DirectConversation ¶
type DirectConversation struct {
// contains filtered or unexported fields
}
DirectConversation - A conversation between a client and an advisor.
func (*DirectConversation) Close ¶
func (c *DirectConversation) Close(ctx context.Context) error
Close - end the conversation
func (*DirectConversation) CustomerID ¶
func (c *DirectConversation) CustomerID() int64
CustomerID - returns the customer ID
func (*DirectConversation) IsAnswered ¶
func (c *DirectConversation) IsAnswered() bool
IsAnswered - check if an advisor has answered this conversation
func (*DirectConversation) IsClosed ¶
func (c *DirectConversation) IsClosed() bool
IsClosed - check if the conversation has already been ended
func (*DirectConversation) Keepalive ¶
func (c *DirectConversation) Keepalive(ctx context.Context, isTyping bool) error
Keepalive - tells the AACC server that the client is still active, and if they are typing
func (*DirectConversation) Name ¶
func (c *DirectConversation) Name() string
Name - returns the customer name
func (*DirectConversation) ReadMessages ¶
ReadMessages - gets any unread message from the AACC server
func (*DirectConversation) SetVerbose ¶
func (c *DirectConversation) SetVerbose(verbose bool)
SetVerbose - enable more detailed logging
func (*DirectConversation) WriteMessage ¶
func (c *DirectConversation) WriteMessage(ctx context.Context, message string) error
WriteMessage - set a message to the AACC server
type Throttle ¶
type Throttle struct {
// contains filtered or unexported fields
}
Throttle - Executes queued requests sequentially to stop the server being overloaded Can be pooled if you wish.
func (*Throttle) ThrottleConversation ¶
func (t *Throttle) ThrottleConversation(c Conversation) Conversation
ThrottleConversation - Wraps a conversation with a throttled version
type ThrottledConversation ¶
type ThrottledConversation struct {
// contains filtered or unexported fields
}
ThrottledConversation - A conversation between a client and an advisor in which all requests are performed sequentially on a wrapped conversation. Not thread safe.
func (*ThrottledConversation) Close ¶
func (tc *ThrottledConversation) Close(ctx context.Context) error
Close - close the wrapped conversation
func (*ThrottledConversation) IsAnswered ¶
func (tc *ThrottledConversation) IsAnswered() bool
IsAnswered - check if an advisor has answered the conversation yet
func (*ThrottledConversation) IsClosed ¶
func (tc *ThrottledConversation) IsClosed() bool
IsClosed - is wrapped conversation closed
func (*ThrottledConversation) Keepalive ¶
func (tc *ThrottledConversation) Keepalive(ctx context.Context, isTyping bool) error
Keepalive - Keep chat active, and send "is typing" messages
func (*ThrottledConversation) Name ¶
func (tc *ThrottledConversation) Name() string
Name - of customer
func (*ThrottledConversation) ReadMessages ¶
ReadMessages - Non-blocking read to check for messages from the advisor
func (*ThrottledConversation) SetVerbose ¶
func (tc *ThrottledConversation) SetVerbose(v bool)
SetVerbose - enable more detailed logging
func (*ThrottledConversation) WriteMessage ¶
func (tc *ThrottledConversation) WriteMessage(ctx context.Context, message string) error
WriteMessage - Send chat message