Documentation
¶
Index ¶
- Variables
- func IDList(identifiables interface{}) []string
- type AdditionalLicense
- type AllocationLicense
- type EventSource
- type EventStream
- type IPALicense
- type Identifiable
- type License
- type LicenseMessage
- func (message LicenseMessage) GetType() string
- func (message LicenseMessage) MarshalJSON() ([]byte, error)
- func (message LicenseMessage) Subscribe(session *Session, payload interface{}) error
- func (message *LicenseMessage) UnmarshalJSON(payload []byte) (err error)
- func (message LicenseMessage) Unsubscribe(session *Session) error
- type LicenseProperties
- type LicenseSubscription
- type MediaLicense
- type Message
- type QueryConditions
- type QueryFieldSelector
- type QueryOptions
- type QueryRightsFilter
- type Range
- type Session
- func (session *Session) Connect() (err error)
- func (session *Session) ConnectStation(settings StationSettings) error
- func (session *Session) Disconnect() error
- func (session Session) Events() chan EventSource
- func (session Session) GetID() string
- func (session *Session) GetUsers() ([]User, error)
- func (session *Session) GetUsersWithOptions(options QueryOptions) ([]User, error)
- func (session *Session) GetVersion() (*VersionInfo, error)
- func (session Session) HasSupport(featureName string) bool
- func (session Session) HasSupportWithAtLeastVersion(featureName string, minimumVersion int) bool
- func (session Session) IsConnected() bool
- func (session Session) MarshalJSON() ([]byte, error)
- func (session Session) String() string
- func (session *Session) Subscribe(subscriber Subscription, payload interface{}) error
- func (session *Session) Unsubscribe(unsubscriber Subscription) error
- type SessionFeature
- type SessionOptions
- type SessionStatus
- type StationSettings
- type StatusMessage
- type StatusMessageMessage
- func (subscription StatusMessageMessage) GetType() string
- func (message StatusMessageMessage) MarshalJSON() ([]byte, error)
- func (subscription StatusMessageMessage) Subscribe(session *Session, payload interface{}) error
- func (message *StatusMessageMessage) UnmarshalJSON(payload []byte) (err error)
- func (subscription StatusMessageMessage) Unsubscribe(session *Session) error
- type Subscription
- type Time
- type UpdatedToken
- type User
- type UserStatus
- type UserStatusMessage
- func (message UserStatusMessage) GetType() string
- func (message UserStatusMessage) MarshalJSON() ([]byte, error)
- func (message UserStatusMessage) String() string
- func (message UserStatusMessage) Subscribe(session *Session, payload interface{}) error
- func (message *UserStatusMessage) UnmarshalJSON(payload []byte) (err error)
- func (message UserStatusMessage) Unsubscribe(session *Session) error
- type UserStatusSubscription
- type VersionInfo
- type WorkStationSettings
Constants ¶
This section is empty.
Variables ¶
var VERSION = "0.1.14"
VERSION is the version of this application
Functions ¶
Types ¶
type AdditionalLicense ¶
type AllocationLicense ¶
type AllocationLicense uint32
const ( AssignableAllocation AllocationLicense = iota ConcurrentAllocation )
type EventSource ¶
type EventSource struct {
Type string `json:"__type"`
ID string `json:"eventId"`
Message Message `json:"message"`
}
EventSource describe an Server-Sent Event
type EventStream ¶
type EventStream struct {
Events chan EventSource // listen to this to process EventSource
Logger *logger.Logger
// contains filtered or unexported fields
}
EventStream describes an EventSource processor
func (*EventStream) Connect ¶
func (stream *EventStream) Connect(session *Session, path string) error
Connect connects to the PureConnect Server-Sent Event Service of the Session
Do not forget to call the closeEventStream when you are done
func (EventStream) Disconnect ¶
func (stream EventStream) Disconnect()
Disconnect disconnects the EventStream
type IPALicense ¶
type IPALicense uint32
const ( IPADirectRoutedWorkItems IPALicense = iota IPAGroupRoutedWorkItems IPAProcessMonitor IPAProcessDesigner )
type Identifiable ¶
type Identifiable interface {
GetID() string
}
type LicenseMessage ¶
type LicenseMessage struct {
Licenses []License `json:"licenseAssignedStatusList"`
IsDelta bool `json:"isDelta"`
}
func (LicenseMessage) GetType ¶
func (message LicenseMessage) GetType() string
GetType tells the JSON type
implements core.TypeCarrier
func (LicenseMessage) MarshalJSON ¶
func (message LicenseMessage) MarshalJSON() ([]byte, error)
MarshalJSON marshals into JSON
implements json.Marshaler
func (LicenseMessage) Subscribe ¶
func (message LicenseMessage) Subscribe(session *Session, payload interface{}) error
Subscribe subscribe a Session to this type of messages
implements Subscriber
func (*LicenseMessage) UnmarshalJSON ¶
func (message *LicenseMessage) UnmarshalJSON(payload []byte) (err error)
UnmarshalJSON unmarshals from JSON
implements json.Unmarshaler
func (LicenseMessage) Unsubscribe ¶
func (message LicenseMessage) Unsubscribe(session *Session) error
Subscribe subscribe a Session to this type of messages
implements Unsubscriber
type LicenseProperties ¶
type LicenseProperties struct {
Active bool `json:"licenseActive"`
HasClientAccess bool `json:"hasClientAccess"`
MediaLicense MediaLicense `json:"mediaLevel"`
AllocationType AllocationLicense `json:"allocationType"`
IPALicense IPALicense `json:"interactionProcessorAutomationType"`
AdditionalLicenses []AdditionalLicense `json:"additionalLicenses"`
}
type LicenseSubscription ¶
type LicenseSubscription struct {
Licenses []string `json:"licenseList"`
}
LicenseSubscription describes a License Subscription Request
type Message ¶
type Message interface {
core.TypeCarrier
}
func UnmarshalMessage ¶
UnmarshalMessage unmarshals from a JSON payload
type QueryConditions ¶
type QueryConditions []string
type QueryFieldSelector ¶
type QueryFieldSelector []string
type QueryOptions ¶
type QueryOptions struct {
Fields QueryFieldSelector `json:"select"`
Where QueryConditions `json:"where"`
Rights QueryRightsFilter `json:"rightsFilter"`
ActualValues bool `json:"actualValues"`
InheritedValues bool `json:"inheritedValues"`
SinglePropertyInheritedFrom bool `json:"singlePropertyInheritedFrom"`
}
func (QueryOptions) AsQueryParameters ¶
func (options QueryOptions) AsQueryParameters() map[string]string
AsQueryParameters return a parameter map for session.send
type QueryRightsFilter ¶
type QueryRightsFilter string
type Range ¶
func GetRangeFromHeader ¶
Get a Range from an HTTP Header map
func (Range) IsCollapsed ¶
IsCollapsed tells if the range is collapsed
A range is considered collapsed if its First and Last Indices are the same
type Session ¶
type Session struct {
ID string `json:"id"`
Token string `json:"token"`
Cookies []*http.Cookie `json:"cookies"`
Timezone string `json:"timezone"` // ???
APIRoot *url.URL `json:"-"`
Version VersionInfo `json:"pureconnectVersion"`
User User `json:"user"`
DefaultWorkstationID string `json:"defaultWorkstationId"`
StationSettings StationSettings `json:"stationSettings"`
Status SessionStatus `json:"status"`
Features []SessionFeature `json:"features"`
Subscriptions map[string]Subscription `json:"-"`
Logger *logger.Logger `json:"-"`
SessionOptions
// contains filtered or unexported fields
}
Session describes a session connected to a PureConnect server
func NewSession ¶
func NewSession(options SessionOptions) *Session
NewSession creates a new Session
Warning: The Session is NOT connected
To give a logger.Logger to the Session, pass it to the context.Context
func (*Session) Connect ¶
Connect connects to a PureConnect Server
If the Session is currently connected, nothing is done
func (*Session) ConnectStation ¶
func (session *Session) ConnectStation(settings StationSettings) error
ConnectStation connects to a Station
func (*Session) Disconnect ¶
Disconnect disconnects the Session from PureConnect
All subscriptions are canceled prior to the disconnection. Also disconnected the Station, if any.
func (Session) Events ¶
func (session Session) Events() chan EventSource
Events gives the EventSource chan to read for new Server-Sent Events from PureConnect
func (*Session) GetUsersWithOptions ¶
func (session *Session) GetUsersWithOptions(options QueryOptions) ([]User, error)
GetUsers retrieves a list of Users
func (*Session) GetVersion ¶
func (session *Session) GetVersion() (*VersionInfo, error)
GetVersion retrieves the PureConnect version
func (Session) HasSupport ¶
HasSupport tells if the Session supports the given PureConnect feature
func (Session) HasSupportWithAtLeastVersion ¶
HasSupport tells if the Session supports the given PureConnect feature
func (Session) IsConnected ¶
IsConnected tells if the Session is connected to a PureConnect server
func (*Session) Subscribe ¶
func (session *Session) Subscribe(subscriber Subscription, payload interface{}) error
func (*Session) Unsubscribe ¶
func (session *Session) Unsubscribe(unsubscriber Subscription) error
type SessionFeature ¶
SessionFeature describes a feature supported by PureConnect Servers
type SessionOptions ¶
type SessionOptions struct {
Context context.Context `json:"-"`
Servers []*url.URL `json:"-"`
UserID string `json:"-"`
Password string `json:"-"`
Application string `json:"applicationName"`
Language string `json:"language"`
TokenUpdated chan UpdatedToken `json:"-"`
}
SessionOptions describes the options of a Session
To give a Logger to the Session, pass it to the Context ¶
The Context will be passed to the TokenUpdated chan (if any) when the Token changes allowing application to pass data through it.
type SessionStatus ¶
type SessionStatus uint32
SessionStatus reflects the status of the Session
const ( UnknownStatus SessionStatus = iota ConnectedStatus ConnectingStatus DisconnectedStatus DisconnectingStatus ChangingStatus )
func (SessionStatus) MarshalText ¶
func (status SessionStatus) MarshalText() ([]byte, error)
MarshalText marshals this SessionStatus into a textual form
implements encoding.TextMarshaler
func (SessionStatus) String ¶
func (status SessionStatus) String() string
String gets a text representation
implements fmt.Stringer
type StationSettings ¶
type StationSettings interface {
Connect(session *Session) error
Disconnect(session *Session) error
core.TypeCarrier
}
func UnmarshalStationSettings ¶
func UnmarshalStationSettings(payload []byte) (StationSettings, error)
UnmarshalStationSettings unmarshals from a JSON payload
type StatusMessage ¶
type StatusMessage struct {
ID string `json:"statusId"`
SystemID string `json:"systemId"`
Text string `json:"messageText"`
IconURI string `json:"iconUri"`
GroupTag string `json:"groupTag"`
CanHaveDate bool `json:"canHaveDate"`
CanHaveTime bool `json:"canHaveTime"`
IsDoNotDisturb bool `json:"isDoNotDisturbStatus"`
IsSelectable bool `json:"isSelectableStatus"`
IsPersistent bool `json:"isPersistentStatus"`
IsForward bool `json:"isForwardStatus"`
IsAfterCallWork bool `json:"isAfterCallWorkStatus"`
IsACD bool `json:"isACDStatus"`
IsAllowFollowUp bool `json:"isAllowFollowUpStatus"`
}
StatusMessage describes a Status Message
func (StatusMessage) GetID ¶
func (status StatusMessage) GetID() string
GetID tells the ID
implements Identifiable
type StatusMessageMessage ¶
type StatusMessageMessage struct {
AddedMessages []StatusMessage `json:"statusMessagesAdded"`
ChangedMessages []StatusMessage `json:"statusMessagesChanged"`
RemovedMessages []string `json:"statusMessagesRemoved"`
IsDelta bool `json:"isDelta"`
}
func (StatusMessageMessage) GetType ¶
func (subscription StatusMessageMessage) GetType() string
GetType tells the JSON type
implements core.TypeCarrier
func (StatusMessageMessage) MarshalJSON ¶
func (message StatusMessageMessage) MarshalJSON() ([]byte, error)
MarshalJSON marshals into JSON
implements json.Marshaler
func (StatusMessageMessage) Subscribe ¶
func (subscription StatusMessageMessage) Subscribe(session *Session, payload interface{}) error
Subscribe subscribe a Session to this type of messages
implements Subscriber
func (*StatusMessageMessage) UnmarshalJSON ¶
func (message *StatusMessageMessage) UnmarshalJSON(payload []byte) (err error)
UnmarshalJSON unmarshals from JSON
implements json.Unmarshaler
func (StatusMessageMessage) Unsubscribe ¶
func (subscription StatusMessageMessage) Unsubscribe(session *Session) error
Subscribe subscribe a Session to this type of messages
implements Unsubscriber
type Subscription ¶
type Time ¶
type UpdatedToken ¶
type UpdatedToken struct {
Token string `json:"token"`
UpdatedAt time.Time `json:"updatedAt"`
Context context.Context `json:"context"`
}
UpdatedToken describes the event sent to a chan letting applications know about new Token
type User ¶
type User struct {
ID string `json:"id"`
DisplayName string `json:"displayName,omitempty"`
SelfUri string `json:"uri"`
License LicenseProperties
}
User describes a PureConnect User
type UserStatus ¶
type UserStatus struct {
UserID string `json:"userId"`
StatusID string `json:"statusId"`
IsLoggedIn bool `json:"loggedIn"`
IsOnPhone bool `json:"onPhone"`
OnPhoneChangedAt time.Time `json:"-"`
ChangedAt time.Time `json:"-"`
Servers []string `json:"icServers"`
Stations []string `json:"stations"`
}
UserStatus describes a User Status
func (UserStatus) MarshalJSON ¶
func (message UserStatus) MarshalJSON() ([]byte, error)
MarshalJSON marshals into JSON
implements json.Marshaler
func (UserStatus) String ¶
func (message UserStatus) String() string
String gets a text representation
implements fmt.Stringer
func (*UserStatus) UnmarshalJSON ¶
func (message *UserStatus) UnmarshalJSON(payload []byte) (err error)
UnmarshalJSON unmarshals from JSON
implements json.Unmarshaler
type UserStatusMessage ¶
type UserStatusMessage struct {
UserStatuses []UserStatus `json:"userStatusList"`
IsDelta bool `json:"isDelta"`
}
func (UserStatusMessage) GetType ¶
func (message UserStatusMessage) GetType() string
GetType tells the JSON type
implements core.TypeCarrier
func (UserStatusMessage) MarshalJSON ¶
func (message UserStatusMessage) MarshalJSON() ([]byte, error)
MarshalJSON marshals into JSON
implements json.Marshaler
func (UserStatusMessage) String ¶
func (message UserStatusMessage) String() string
String gets a text representation
implements fmt.Stringer
func (UserStatusMessage) Subscribe ¶
func (message UserStatusMessage) Subscribe(session *Session, payload interface{}) error
Subscribe subscribe a Session to this type of messages
implements Subscriber
func (*UserStatusMessage) UnmarshalJSON ¶
func (message *UserStatusMessage) UnmarshalJSON(payload []byte) (err error)
UnmarshalJSON unmarshals from JSON
implements json.Unmarshaler
func (UserStatusMessage) Unsubscribe ¶
func (message UserStatusMessage) Unsubscribe(session *Session) error
Subscribe subscribe a Session to this type of messages
implements Unsubscriber
type UserStatusSubscription ¶
type UserStatusSubscription struct {
UserIDs []string `json:"userIds"`
Properties []string `json:"userStatusProperties,omitempty"`
}
UserStatusSubscription describes a UserStatus Subscription Request
type VersionInfo ¶
type VersionInfo struct {
Major int `json:"-"`
Minor int `json:"-"`
Patch int `json:"-"`
Build int `json:"-"`
Product string `json:"productId"`
Codebase string `json:"codebaseId"`
ProductRelease string `json:"productReleaseDisplayString"`
ProductPath string `json:"productPatchDisplayString"`
}
VersionInfo describes the PureConnect Version
func (*VersionInfo) UnmarshalJSON ¶
func (version *VersionInfo) UnmarshalJSON(payload []byte) (err error)
UnmarshalJSON unmarshals from JSON
implements json.Unmarshaler
type WorkStationSettings ¶
type WorkStationSettings struct {
}
func (WorkStationSettings) GetType ¶
func (settings WorkStationSettings) GetType() string
GetType tells the JSON type
implements core.TypeCarrier
func (WorkStationSettings) MarshalJSON ¶
func (message WorkStationSettings) MarshalJSON() ([]byte, error)
MarshalJSON marshals into JSON
implements json.Marshaler
func (*WorkStationSettings) UnmarshalJSON ¶
func (message *WorkStationSettings) UnmarshalJSON(payload []byte) (err error)
UnmarshalJSON unmarshals from JSON
implements json.Unmarshaler