avaya

package module
v0.0.0-...-c4ef217 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 10, 2017 License: GPL-3.0 Imports: 9 Imported by: 1

README

Go Avaya / AACC chat client

Go library providing an API to the AACC SOAP interface.

Usage

See example/main.go

Also, throttled_conversation.go if you wish to limit connections to the server.

Copyright

Copyright (c) 2017 The Book People

See LICENSE (GPLv3)

Documentation

Index

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 NewClient

func NewClient(proto, host string) Client

NewClient - creates a new 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

func (c Client) AnonymousLogin(ctx context.Context) (string, int64, error)

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

func (c Client) EndSession(ctx context.Context, sessionKey string, contactID int64) error

EndSession - stop the conversation

func (Client) IsSkillsetInService

func (c Client) IsSkillsetInService(ctx context.Context, skillsetName string) (bool, error)

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) Skillset

func (c Client) Skillset(ctx context.Context, sessionID, name string) (*Skillset, error)

Skillset - create a Skillset for a given name & session

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

func (c *DirectConversation) ReadMessages(ctx context.Context) ([]Message, bool, error)

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 Message

type Message struct {
	Text   string
	Type   string
	Hidden string
	Time   int64
}

Message - a message from Avaya

type Skillset

type Skillset struct {
	ID   int64
	Name string
}

Skillset - an AACC skillset (e.g. can handle orders, complaints etc..)

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 NewThrottle

func NewThrottle() *Throttle

NewThrottle - Creates a Throttle

func (*Throttle) Close

func (t *Throttle) Close()

Close - closes the request queue channel

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

func (tc *ThrottledConversation) ReadMessages(ctx context.Context) ([]Message, bool, error)

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL