Documentation
¶
Index ¶
- func FromRestID(restID string) (string, error)
- func ToRestID(uuid string, resourceType string) string
- type AttachmentAction
- type AuthError
- type Config
- type ConnectionStatus
- type DecryptedMessage
- type DecryptionError
- type DeletedMessage
- type DeviceManager
- type DeviceRegistration
- type DeviceRegistrationError
- type FetchFunc
- type FetchRequest
- type FetchResponse
- type HandlerStatus
- type KmsClient
- type KmsClientConfig
- type KmsError
- type Logger
- type MembershipActivity
- type MercuryActivity
- type MercuryActor
- type MercuryConnectionError
- type MercuryEnvelope
- type MercuryObject
- type MercuryParent
- type MercurySocket
- func (ms *MercurySocket) Connect(ctx context.Context, wsURL, token string) error
- func (ms *MercurySocket) Connected() bool
- func (ms *MercurySocket) CurrentReconnectAttempts() int
- func (ms *MercurySocket) Disconnect()
- func (ms *MercurySocket) OnActivity(fn func(activity MercuryActivity))
- func (ms *MercurySocket) OnConnected(fn func())
- func (ms *MercurySocket) OnDisconnected(fn func(reason string))
- func (ms *MercurySocket) OnError(fn func(err error))
- func (ms *MercurySocket) OnKmsResponse(fn func(data map[string]interface{}))
- func (ms *MercurySocket) OnReconnecting(fn func(attempt int))
- type MercurySocketConfig
- type MercuryTarget
- type MessageDecryptor
- type MetricsCallback
- type MetricsEvent
- type NetworkMode
- type ParsedMentions
- type RoomActivity
- type SlogLogger
- type WebSocket
- type WebSocketFactory
- type WebexError
- type WebexMessageHandler
- func (h *WebexMessageHandler) Connect(ctx context.Context) error
- func (h *WebexMessageHandler) Connected() bool
- func (h *WebexMessageHandler) DeviceRegistration() *DeviceRegistration
- func (h *WebexMessageHandler) Disconnect(ctx context.Context) error
- func (h *WebexMessageHandler) OnAttachmentActionCreated(fn func(action AttachmentAction))
- func (h *WebexMessageHandler) OnConnected(fn func())
- func (h *WebexMessageHandler) OnDisconnected(fn func(reason string))
- func (h *WebexMessageHandler) OnError(fn func(err error))
- func (h *WebexMessageHandler) OnMembershipCreated(fn func(activity MembershipActivity))
- func (h *WebexMessageHandler) OnMessageCreated(fn func(msg DecryptedMessage))
- func (h *WebexMessageHandler) OnMessageDeleted(fn func(data DeletedMessage))
- func (h *WebexMessageHandler) OnMessageUpdated(fn func(msg DecryptedMessage))
- func (h *WebexMessageHandler) OnReconnecting(fn func(attempt int))
- func (h *WebexMessageHandler) OnRoomCreated(fn func(activity RoomActivity))
- func (h *WebexMessageHandler) OnRoomUpdated(fn func(activity RoomActivity))
- func (h *WebexMessageHandler) Reconnect(ctx context.Context, newToken string) error
- func (h *WebexMessageHandler) ServiceURL(name string) (string, bool)
- func (h *WebexMessageHandler) Status() HandlerStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromRestID ¶ added in v0.6.4
FromRestID converts a Webex REST API ID back to a raw UUID.
Types ¶
type AttachmentAction ¶ added in v0.6.6
type AttachmentAction struct {
// ID is the activity ID.
ID string
// MessageID is the ID of the message the card was attached to.
MessageID string
// PersonID is the ID of the person who submitted the card.
PersonID string
// PersonEmail is the email of the person who submitted the card.
PersonEmail string
// RoomID is the conversation/space ID.
RoomID string
// Inputs contains the card form input values.
Inputs map[string]interface{}
// Created is the ISO 8601 timestamp.
Created string
// Raw is the full raw activity for advanced use.
Raw *MercuryActivity
}
AttachmentAction represents an adaptive card submission from Mercury.
type AuthError ¶
type AuthError struct {
WebexError
}
AuthError indicates the token is invalid, expired, or unauthorized.
func NewAuthError ¶
type Config ¶
type Config struct {
// Token is the Webex bot or user access token (required).
Token string
// Mode is the networking mode: "native" or "injected" (default: "native").
Mode NetworkMode
// Logger is an optional logger implementation (silent by default).
Logger Logger
// HTTPClient is an optional HTTP client for proxy support (native mode only).
// If nil, http.DefaultClient is used.
HTTPClient *http.Client
// Fetch is a custom fetch function for all HTTP requests (injected mode).
Fetch FetchFunc
// WebSocketFactory is a custom WebSocket factory (injected mode).
WebSocketFactory WebSocketFactory
// PingInterval is the Mercury ping interval in seconds (default: 15).
PingInterval float64
// PongTimeout is the pong response timeout in seconds (default: 14).
PongTimeout float64
// ReconnectBackoffMax is the max reconnect backoff in seconds (default: 32).
ReconnectBackoffMax float64
// MaxReconnectAttempts is the max consecutive reconnection attempts (default: 10).
MaxReconnectAttempts int
// ReconnectStabilitySeconds is how long a connection must hold before the
// reconnect-attempt counter resets (default: 60). Without this window a flap
// storm — repeated connections that succeed and then drop seconds later —
// zeroes the counter every cycle, so MaxReconnectAttempts never trips and the
// handler retries forever instead of surfacing max-attempts-exceeded.
ReconnectStabilitySeconds float64
// IgnoreSelfMessages filters out messages sent by this bot to prevent loops (default: true).
// Set to false explicitly via IgnoreSelfMessagesPtr if you need to receive bot's own messages.
IgnoreSelfMessages *bool
// MetricsCallback is an optional callback for receiving timing metrics (no overhead if not set).
MetricsCallback MetricsCallback
}
Config holds configuration for WebexMessageHandler.
type ConnectionStatus ¶
type ConnectionStatus string
ConnectionStatus represents the overall connection state.
const ( StatusConnected ConnectionStatus = "connected" StatusConnecting ConnectionStatus = "connecting" StatusReconnecting ConnectionStatus = "reconnecting" StatusDisconnected ConnectionStatus = "disconnected" )
type DecryptedMessage ¶
type DecryptedMessage struct {
// ID is the Mercury activity UUID. Works as parentId for threaded replies.
ID string
// URL is the full Conversation-service activity URL, when present on the
// raw Mercury activity (e.g. for an outbound "acknowledge" read-receipt).
// Empty if Mercury did not include it.
URL string
// ParentID is the parent activity UUID for threaded replies. Empty if not a thread reply.
ParentID string
// MentionedPeople contains person UUIDs mentioned via @mention in the message.
MentionedPeople []string
// MentionedGroups contains group mention types (e.g. "all") in the message.
MentionedGroups []string
// RoomID is the conversation/space ID.
RoomID string
// PersonID is the sender's user ID.
PersonID string
// PersonEmail is the sender's email address.
PersonEmail string
// Text is the decrypted plain text.
Text string
// HTML is the decrypted HTML content (rich text messages).
HTML string
// Created is the ISO 8601 timestamp.
Created string
// RoomType is "direct", "group", or empty.
RoomType string
// Files contains file URLs attached to the message.
Files []string
// Raw is the full decrypted activity for advanced use.
Raw *MercuryActivity
}
DecryptedMessage is a decrypted Webex message.
type DecryptionError ¶
type DecryptionError struct {
WebexError
}
DecryptionError indicates message decryption failure.
func NewDecryptionError ¶
func NewDecryptionError(message string) *DecryptionError
func NewDecryptionErrorWithCause ¶
func NewDecryptionErrorWithCause(message string, cause error) *DecryptionError
type DeletedMessage ¶
DeletedMessage represents a deleted Webex message notification.
type DeviceManager ¶
type DeviceManager struct {
// contains filtered or unexported fields
}
DeviceManager manages WDM device registration lifecycle.
func NewDeviceManager ¶
func NewDeviceManager(logger Logger, httpDo fetchDoFn) *DeviceManager
NewDeviceManager creates a new DeviceManager.
func (*DeviceManager) Refresh ¶
func (dm *DeviceManager) Refresh(ctx context.Context, token string) (*DeviceRegistration, error)
Refresh refreshes an existing device registration.
func (*DeviceManager) Register ¶
func (dm *DeviceManager) Register(ctx context.Context, token string) (*DeviceRegistration, error)
Register obtains a usable WDM device registration.
To avoid leaking a new device on every Connect() (which eventually trips the Webex per-user device cap → HTTP 403), it first lists existing devices and reuses/refreshes one matching this client's name+deviceType. Only when no reusable device exists does it POST a new one. If registration fails because the account already has excessive registrations, it reaps this client's own devices and retries once.
func (*DeviceManager) Unregister ¶
func (dm *DeviceManager) Unregister(ctx context.Context, token string) error
Unregister unregisters the device from WDM.
type DeviceRegistration ¶
type DeviceRegistration struct {
// WebSocketURL is the Mercury WebSocket URL.
WebSocketURL string `json:"webSocketUrl"`
// DeviceURL is the device URL (used as clientId for KMS).
DeviceURL string `json:"url"`
// UserID is the bot's user ID.
UserID string `json:"userId"`
// Services is the service catalog from WDM.
Services map[string]string `json:"services"`
// EncryptionServiceURL is extracted from Services.
EncryptionServiceURL string `json:"-"`
}
DeviceRegistration holds the result of WDM device registration.
type DeviceRegistrationError ¶
type DeviceRegistrationError struct {
WebexError
StatusCode int
}
DeviceRegistrationError indicates WDM device operations failed.
func NewDeviceRegistrationError ¶
func NewDeviceRegistrationError(message string, statusCode int) *DeviceRegistrationError
type FetchFunc ¶
type FetchFunc func(ctx context.Context, req FetchRequest) (*FetchResponse, error)
FetchFunc is a custom fetch function for injected mode.
type FetchRequest ¶
FetchRequest represents an HTTP request for injected fetch function.
type FetchResponse ¶
type FetchResponse struct {
Status int
OK bool
Body io.ReadCloser
}
FetchResponse represents an HTTP response from injected fetch function.
type HandlerStatus ¶
type HandlerStatus struct {
// Status is the overall connection state.
Status ConnectionStatus
// WebSocketOpen indicates whether the Mercury WebSocket is currently open.
WebSocketOpen bool
// KmsInitialized indicates whether the KMS encryption context has been established.
KmsInitialized bool
// DeviceRegistered indicates whether the device is registered with WDM.
DeviceRegistered bool
// ReconnectAttempt is the current auto-reconnect attempt number (0 if not reconnecting).
ReconnectAttempt int
}
HandlerStatus is a structured health check of all connection subsystems.
type KmsClient ¶
type KmsClient struct {
// contains filtered or unexported fields
}
KmsClient handles KMS ECDH key exchange and encryption key retrieval.
func NewKmsClient ¶
func NewKmsClient(cfg KmsClientConfig) *KmsClient
NewKmsClient creates a new KmsClient.
func (*KmsClient) HandleKmsMessage ¶
HandleKmsMessage handles a KMS response that arrived via Mercury WebSocket.
type KmsClientConfig ¶
type KmsClientConfig struct {
Token string
DeviceURL string
UserID string
EncryptionServiceURL string
Logger Logger
HTTPDo fetchDoFn
}
KmsClientConfig holds the configuration for KmsClient.
type KmsError ¶
type KmsError struct {
WebexError
}
KmsError indicates KMS key exchange or key retrieval failure.
func NewKmsError ¶
func NewKmsErrorWithCause ¶
type Logger ¶
type Logger interface {
Debug(msg string, args ...any)
Info(msg string, args ...any)
Warn(msg string, args ...any)
Error(msg string, args ...any)
}
Logger defines the logging interface used by the handler. Compatible with *slog.Logger via the SlogAdapter.
func NewSlogLogger ¶
NewSlogLogger creates a Logger from a *slog.Logger.
type MembershipActivity ¶
type MembershipActivity struct {
// ID is the activity ID.
ID string
// ActorID is the ID of the person who performed the action.
ActorID string
// PersonID is the ID of the member affected.
PersonID string
// RoomID is the conversation/space ID.
RoomID string
// Action is the membership action: "add", "leave", "assignModerator", or "unassignModerator".
Action string
// Created is the ISO 8601 timestamp.
Created string
// RoomType is "direct", "group", or empty.
RoomType string
// Raw is the full raw activity for advanced use.
Raw *MercuryActivity
}
MembershipActivity represents a membership event from Mercury.
type MercuryActivity ¶
type MercuryActivity struct {
ID string `json:"id"`
URL string `json:"url,omitempty"`
Verb string `json:"verb"`
Actor MercuryActor `json:"actor"`
Object MercuryObject `json:"object"`
Target MercuryTarget `json:"target"`
Published string `json:"published"`
EncryptionKeyURL string `json:"encryptionKeyUrl,omitempty"`
Parent *MercuryParent `json:"parent,omitempty"`
}
MercuryActivity represents a conversation activity from Mercury.
type MercuryActor ¶
type MercuryActor struct {
ID string `json:"id"`
ObjectType string `json:"objectType"`
EmailAddress string `json:"emailAddress,omitempty"`
}
MercuryActor represents the actor in a Mercury activity.
type MercuryConnectionError ¶
type MercuryConnectionError struct {
WebexError
CloseCode int
}
MercuryConnectionError indicates WebSocket connection failure.
func NewMercuryConnectionError ¶
func NewMercuryConnectionError(message string, closeCode int) *MercuryConnectionError
type MercuryEnvelope ¶
type MercuryEnvelope struct {
ID string `json:"id"`
Data map[string]interface{} `json:"data"`
Timestamp int64 `json:"timestamp"`
TrackingID string `json:"trackingId"`
SequenceNumber *int64 `json:"sequenceNumber,omitempty"`
}
MercuryEnvelope is the wire format envelope from Mercury WebSocket.
type MercuryObject ¶
type MercuryObject struct {
ID string `json:"id"`
ObjectType string `json:"objectType"`
DisplayName string `json:"displayName,omitempty"`
Content string `json:"content,omitempty"`
EncryptionKeyURL string `json:"encryptionKeyUrl,omitempty"`
// Inputs holds the decrypted card-action form values on cardAction/submit
// activities. On the wire object.inputs is a JWE-encrypted string (see
// InputsEncrypted); it is decrypted into this map by the message decryptor.
Inputs map[string]interface{} `json:"inputs,omitempty"`
// InputsEncrypted holds the raw JWE ciphertext of object.inputs as delivered
// by Mercury, before decryption. Card-action inputs are encrypted under the
// activity's encryptionKeyUrl (same KMS key path as message content), so the
// decryptor must resolve the key and decrypt this into Inputs.
InputsEncrypted string `json:"-"`
Files []string `json:"files,omitempty"`
}
MercuryObject represents the object in a Mercury activity.
type MercuryParent ¶ added in v0.6.4
MercuryParent represents a parent activity reference for threaded replies.
type MercurySocket ¶
type MercurySocket struct {
// contains filtered or unexported fields
}
MercurySocket manages the Mercury WebSocket connection.
func NewMercurySocket ¶
func NewMercurySocket(cfg MercurySocketConfig) *MercurySocket
NewMercurySocket creates a new MercurySocket.
func (*MercurySocket) Connect ¶
func (ms *MercurySocket) Connect(ctx context.Context, wsURL, token string) error
Connect connects to Mercury WebSocket.
func (*MercurySocket) Connected ¶
func (ms *MercurySocket) Connected() bool
Connected returns whether the WebSocket is currently open.
func (*MercurySocket) CurrentReconnectAttempts ¶
func (ms *MercurySocket) CurrentReconnectAttempts() int
CurrentReconnectAttempts returns the current reconnection attempt count.
func (*MercurySocket) Disconnect ¶
func (ms *MercurySocket) Disconnect()
Disconnect disconnects from Mercury.
func (*MercurySocket) OnActivity ¶
func (ms *MercurySocket) OnActivity(fn func(activity MercuryActivity))
OnActivity sets the activity event callback.
func (*MercurySocket) OnConnected ¶
func (ms *MercurySocket) OnConnected(fn func())
OnConnected sets the connected event callback.
func (*MercurySocket) OnDisconnected ¶
func (ms *MercurySocket) OnDisconnected(fn func(reason string))
OnDisconnected sets the disconnected event callback.
func (*MercurySocket) OnError ¶
func (ms *MercurySocket) OnError(fn func(err error))
OnError sets the error event callback.
func (*MercurySocket) OnKmsResponse ¶
func (ms *MercurySocket) OnKmsResponse(fn func(data map[string]interface{}))
OnKmsResponse sets the kms:response event callback.
func (*MercurySocket) OnReconnecting ¶
func (ms *MercurySocket) OnReconnecting(fn func(attempt int))
OnReconnecting sets the reconnecting event callback.
type MercurySocketConfig ¶
type MercurySocketConfig struct {
Logger Logger
WSFactory wsFactoryFn
PingInterval time.Duration
PongTimeout time.Duration
ReconnectBackoffMax time.Duration
MaxReconnectAttempts int
ReconnectStability time.Duration
}
MercurySocketConfig holds options for MercurySocket.
type MercuryTarget ¶
type MercuryTarget struct {
ID string `json:"id"`
ObjectType string `json:"objectType"`
EncryptionKeyURL string `json:"encryptionKeyUrl,omitempty"`
Tags []string `json:"tags,omitempty"`
}
MercuryTarget represents the target in a Mercury activity.
type MessageDecryptor ¶
type MessageDecryptor struct {
// contains filtered or unexported fields
}
MessageDecryptor decrypts encrypted Webex message activities using KMS keys.
func NewMessageDecryptor ¶
func NewMessageDecryptor(kmsClient *KmsClient, logger Logger) *MessageDecryptor
NewMessageDecryptor creates a new MessageDecryptor.
func (*MessageDecryptor) DecryptActivity ¶
func (md *MessageDecryptor) DecryptActivity(ctx context.Context, activity MercuryActivity) (MercuryActivity, error)
DecryptActivity decrypts an encrypted Mercury activity. Returns a copy with decrypted DisplayName and Content fields. If the activity is not encrypted (no EncryptionKeyURL), returns as-is.
type MetricsCallback ¶ added in v0.6.9
type MetricsCallback func(event MetricsEvent)
MetricsCallback is a callback function for receiving metrics events.
type MetricsEvent ¶ added in v0.6.9
type MetricsEvent struct {
// Name is the metric name: "connect", "kms_fetch", or "decrypt".
Name string
// DurationMs is the duration in milliseconds.
DurationMs float64
// Success indicates whether the operation succeeded.
Success bool
// Metadata is optional context (e.g., key URI for kms_fetch).
Metadata map[string]string
}
MetricsEvent is a timing metric event.
type NetworkMode ¶
type NetworkMode string
NetworkMode defines the networking mode for the handler.
const ( // NetworkModeNative uses built-in HTTP and WebSocket libraries. NetworkModeNative NetworkMode = "native" // NetworkModeInjected uses provided fetch and WebSocket factory functions. NetworkModeInjected NetworkMode = "injected" )
type ParsedMentions ¶ added in v0.6.6
ParsedMentions holds person and group mentions extracted from message HTML.
func ParseMentions ¶ added in v0.6.6
func ParseMentions(html string) ParsedMentions
ParseMentions extracts mentioned people and groups from decrypted HTML.
Parses <spark-mention> tags to find person UUIDs and group mention types (e.g. "all"). Duplicates are removed.
type RoomActivity ¶ added in v0.6.6
type RoomActivity struct {
// ID is the activity ID.
ID string
// RoomID is the conversation/space ID.
RoomID string
// ActorID is the ID of the person who performed the action.
ActorID string
// Action is the room action: "created" or "updated".
Action string
// Created is the ISO 8601 timestamp.
Created string
// Raw is the full raw activity for advanced use.
Raw *MercuryActivity
}
RoomActivity represents a room event from Mercury.
type SlogLogger ¶
SlogLogger wraps a *slog.Logger to implement the Logger interface.
func (*SlogLogger) Debug ¶
func (s *SlogLogger) Debug(msg string, args ...any)
func (*SlogLogger) Error ¶
func (s *SlogLogger) Error(msg string, args ...any)
func (*SlogLogger) Info ¶
func (s *SlogLogger) Info(msg string, args ...any)
func (*SlogLogger) Warn ¶
func (s *SlogLogger) Warn(msg string, args ...any)
type WebSocket ¶
type WebSocket interface {
Send(data string) error
Receive() (string, error)
Close() error
Done() <-chan struct{}
}
WebSocket represents a WebSocket connection interface.
type WebSocketFactory ¶
WebSocketFactory creates WebSocket connections for injected mode.
type WebexError ¶
WebexError is the base error type for all webex-message-handler errors.
func (*WebexError) Error ¶
func (e *WebexError) Error() string
func (*WebexError) Unwrap ¶
func (e *WebexError) Unwrap() error
type WebexMessageHandler ¶
type WebexMessageHandler struct {
// contains filtered or unexported fields
}
WebexMessageHandler receives and decrypts Webex messages over Mercury WebSocket.
func New ¶
func New(cfg Config) (*WebexMessageHandler, error)
New creates a new WebexMessageHandler.
func (*WebexMessageHandler) Connect ¶
func (h *WebexMessageHandler) Connect(ctx context.Context) error
Connect establishes the full connection pipeline.
func (*WebexMessageHandler) Connected ¶
func (h *WebexMessageHandler) Connected() bool
Connected returns whether the handler is fully connected.
func (*WebexMessageHandler) DeviceRegistration ¶ added in v0.6.10
func (h *WebexMessageHandler) DeviceRegistration() *DeviceRegistration
DeviceRegistration returns a read-only copy of the WDM registration obtained at Connect time, or nil if not yet connected.
This library stays inbound-only — it does not make outbound calls. This accessor exists so wrapper code can perform its own outbound calls (e.g. a Conversation-service read-receipt) using the service catalog the library already holds. Resolve outbound URLs from the returned Services map rather than hardcoding cluster hostnames, which vary across clusters and orgs.
The returned value is a deep copy: mutating it does not affect the handler's internal state, and it remains valid after reconnect/disconnect.
func (*WebexMessageHandler) Disconnect ¶
func (h *WebexMessageHandler) Disconnect(ctx context.Context) error
Disconnect tears down the connection cleanly.
func (*WebexMessageHandler) OnAttachmentActionCreated ¶ added in v0.6.6
func (h *WebexMessageHandler) OnAttachmentActionCreated(fn func(action AttachmentAction))
OnAttachmentActionCreated sets the callback for adaptive card submissions.
func (*WebexMessageHandler) OnConnected ¶
func (h *WebexMessageHandler) OnConnected(fn func())
OnConnected sets the callback for connection events.
func (*WebexMessageHandler) OnDisconnected ¶
func (h *WebexMessageHandler) OnDisconnected(fn func(reason string))
OnDisconnected sets the callback for disconnection events.
func (*WebexMessageHandler) OnError ¶
func (h *WebexMessageHandler) OnError(fn func(err error))
OnError sets the callback for error events.
func (*WebexMessageHandler) OnMembershipCreated ¶
func (h *WebexMessageHandler) OnMembershipCreated(fn func(activity MembershipActivity))
OnMembershipCreated sets the callback for membership events.
func (*WebexMessageHandler) OnMessageCreated ¶
func (h *WebexMessageHandler) OnMessageCreated(fn func(msg DecryptedMessage))
OnMessageCreated sets the callback for new messages.
func (*WebexMessageHandler) OnMessageDeleted ¶
func (h *WebexMessageHandler) OnMessageDeleted(fn func(data DeletedMessage))
OnMessageDeleted sets the callback for deleted messages.
func (*WebexMessageHandler) OnMessageUpdated ¶ added in v0.6.6
func (h *WebexMessageHandler) OnMessageUpdated(fn func(msg DecryptedMessage))
OnMessageUpdated sets the callback for edited messages.
func (*WebexMessageHandler) OnReconnecting ¶
func (h *WebexMessageHandler) OnReconnecting(fn func(attempt int))
OnReconnecting sets the callback for reconnection events.
func (*WebexMessageHandler) OnRoomCreated ¶ added in v0.6.6
func (h *WebexMessageHandler) OnRoomCreated(fn func(activity RoomActivity))
OnRoomCreated sets the callback for room creation events.
func (*WebexMessageHandler) OnRoomUpdated ¶ added in v0.6.6
func (h *WebexMessageHandler) OnRoomUpdated(fn func(activity RoomActivity))
OnRoomUpdated sets the callback for room update events.
func (*WebexMessageHandler) Reconnect ¶
func (h *WebexMessageHandler) Reconnect(ctx context.Context, newToken string) error
Reconnect updates the access token and re-establishes the connection.
func (*WebexMessageHandler) ServiceURL ¶ added in v0.6.10
func (h *WebexMessageHandler) ServiceURL(name string) (string, bool)
ServiceURL returns the URL for a named WDM service from the registration's service catalog (e.g. "conversationServiceUrl"), and whether it was present. Returns ("", false) if not yet connected or the service is unknown.
Use this to discover outbound service base URLs instead of hardcoding cluster hostnames. See DeviceRegistration for the broader rationale.
func (*WebexMessageHandler) Status ¶
func (h *WebexMessageHandler) Status() HandlerStatus
Status returns a structured health check of all connection subsystems.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
basic-bot
command
|
|
|
observe-harness
command
Command observe-harness is a standalone Webex Mercury observation tool.
|
Command observe-harness is a standalone Webex Mercury observation tool. |