device

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2026 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is the Device API client

func New

func New(webexClient *webexsdk.Client, config *Config) *Client

New creates a new Device plugin

func (*Client) GetDevice

func (c *Client) GetDevice() DeviceDTO

GetDevice returns a copy of the current device data

func (*Client) GetDeviceURL

func (c *Client) GetDeviceURL() (string, error)

GetDeviceURL returns the device URL

func (*Client) GetWebSocketURL

func (c *Client) GetWebSocketURL() (string, error)

GetWebSocketURL returns the WebSocket URL for Mercury connections

func (*Client) IsRegistered

func (c *Client) IsRegistered() bool

IsRegistered returns true if the device is registered

func (*Client) OnRegistered

func (c *Client) OnRegistered(callback func())

OnRegistered registers a callback function to be called when the device is registered

func (*Client) Refresh

func (c *Client) Refresh() error

Refresh refreshes the device registration with the Webex service

func (*Client) Register

func (c *Client) Register() error

Register registers a device with Webex to get a WebSocket URL

func (*Client) Unregister

func (c *Client) Unregister() error

Unregister unregisters a device with Webex

func (*Client) WaitForRegistration

func (c *Client) WaitForRegistration(timeout time.Duration) error

WaitForRegistration waits for the device to be registered with a timeout

type Config

type Config struct {
	// Ephemeral determines if the device is temporary and should be refreshed
	Ephemeral bool
	// EphemeralDeviceTTL is the time to live for ephemeral devices in seconds
	EphemeralDeviceTTL int
	// DeviceType specifies the type of device
	DeviceType string
	// DefaultHeaders to include in requests
	DefaultHeaders map[string]string
	// DefaultBody to include in requests
	DefaultBody map[string]interface{}
}

Config holds the configuration for the Device plugin

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns the default configuration for the Device plugin

type DeviceDTO

type DeviceDTO struct {
	URL                         string      `json:"url,omitempty"`
	WebSocketURL                string      `json:"webSocketUrl,omitempty"`
	UserID                      string      `json:"userId,omitempty"`
	DeviceType                  string      `json:"deviceType,omitempty"`
	IntranetInactivityDuration  int         `json:"intranetInactivityDuration,omitempty"`
	InNetworkInactivityDuration int         `json:"inNetworkInactivityDuration,omitempty"`
	ModificationTime            string      `json:"modificationTime,omitempty"`
	Services                    interface{} `json:"services,omitempty"`
	ServiceHostMap              interface{} `json:"serviceHostMap,omitempty"`
	WebFileShareControl         string      `json:"webFileShareControl,omitempty"`
	ClientMessagingGiphy        string      `json:"clientMessagingGiphy,omitempty"`
	ETag                        string      `json:"-"`
}

DeviceDTO represents the response from the WDM service for a device

type DeviceResponse

type DeviceResponse struct {
	URL          string `json:"url"`
	WebSocketURL string `json:"webSocketUrl"`
}

DeviceResponse represents the response from the device registration

Jump to

Keyboard shortcuts

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