Help us shape the future of Go! Take the 2026 Go Developer Survey

devices

package
v1.46.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: Apache-2.0 Imports: 62 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeWireless string = "Wireless"
	TypeTLS      string = "TLS"
	TypeWired    string = "Wired"
)
View Source
const (
	HeaderByteSize             = 9
	ContentLengthPadding       = 8
	RedirectSessionLengthBytes = 13
	RedirectionSessionReply    = 4
	ConnectionTimeout          = 5 * time.Minute
	InactivityTimeout          = 30 * time.Second // Close connection if no data for 30 seconds
	HeartbeatInterval          = 30 * time.Second // Check connection health every 30 seconds
	SlowReceiveThreshold       = 100              // Milliseconds threshold for slow device receive
	SlowWriteThreshold         = 50               // Milliseconds threshold for slow write operations
)
View Source
const (
	BootActionHTTPSBoot         = 105
	BootActionPowerOnHTTPSBoot  = 106
	BootActionPBA               = 107
	BootActionPowerOnPBA        = 108
	BootActionWinREBoot         = 109
	BootActionPowerOnWinREBoot  = 110
	BootActionResetToIDERCDROM  = 202
	BootActionPowerOnIDERCDROM  = 203
	BootActionResetToBIOS       = 101
	BootActionResetToPXE        = 400
	BootActionPowerOnToPXE      = 401
	BootActionResetToDiag       = 301
	BootActionResetToIDERFloppy = 200
	OsToFullPower               = 500
	OsToPowerSaving             = 501
	CIMPMSPowerOn               = 2 // CIM > Power Management Service > Power On
)
View Source
const (
	RedirectionCommandsStartRedirectionSession      = 16
	RedirectionCommandsStartRedirectionSessionReply = 17
	RedirectionCommandsEndRedirectionSession        = 18
	RedirectionCommandsAuthenticateSession          = 19
	RedirectionCommandsAuthenticateSessionReply     = 20
	StartRedirectionSessionReplyStatusSuccess       = 0
	StartRedirectionSessionReplyStatusUnknown       = 1
	StartRedirectionSessionReplyStatusBusy          = 2
	StartRedirectionSessionReplyStatusUnsupported   = 3
	StartRedirectionSessionReplyStatusError         = 0xFF
	AuthenticationTypeQuery                         = 0
	AuthenticationTypeUserPass                      = 1
	AuthenticationTypeKerberos                      = 2
	AuthenticationTypeBadDigest                     = 3
	AuthenticationTypeDigest                        = 4
	AuthenticationStatusSuccess                     = 0
	AuthenticationStatusFail                        = 1
	AuthenticationStatusNotSupported                = 2

	// MinAMTVersion - minimum AMT version required for certain features in power capabilities.
	MinAMTVersion = 9
)

Variables

View Source
var (
	ErrCertificateNotFound           = fmt.Errorf("certificate not found")
	ErrCertificateAssociatedProfiles = fmt.Errorf("certificate is associated with profiles")
	ErrCertificateReadOnly           = fmt.Errorf("certificate is read-only")
)
View Source
var (
	ErrValidationUseCase = ValidationError{Console: consoleerrors.CreateConsoleError("parameter validation failed")}
	ErrLargeFileUseCase  = ValidationError{Console: consoleerrors.CreateConsoleError("UEFI file too large")}
)
View Source
var (
	ErrDeviceUseCase = consoleerrors.CreateConsoleError("DevicesUseCase")
	ErrDatabase      = repoerrors.DatabaseError{Console: ErrDeviceUseCase}
	ErrNotFound      = repoerrors.NotFoundError{Console: ErrDeviceUseCase}
	ErrCancelled     = dto.CanceledError{Console: ErrDeviceUseCase}
)
View Source
var ErrAMT = AMTError{Console: consoleerrors.CreateConsoleError("DevicesUseCase")}
View Source
var ErrLengthLimit = errors.New("calculated length exceeds uint32 limit")
View Source
var ErrNotSupportedUseCase = NotSupportedError{Console: consoleerrors.CreateConsoleError("Not Supported")}
View Source
var ErrOCRNotSupportedUseCase = NotSupportedError{Console: consoleerrors.CreateConsoleError("One Click Recovery Unsupported")}
View Source
var ErrUEFIProfileSyncNotSupported = errors.New("UEFI WiFi profile sync is not supported on this device")

ErrUEFIProfileSyncNotSupported is returned when a caller requests UEFI WiFi profile sharing on a device whose power capabilities do not support it. The HTTP layer maps this to 409 Conflict and the whole request is rejected (no partial update).

View Source
var UserConsentOptions = map[int]string{
	0:          "none",
	1:          userConsentKVM,
	4294967295: "all",
}

Functions

func FindBootSettingInstances added in v1.9.0

func FindBootSettingInstances(bootSourceSettings []cimBoot.BootSourceSetting) dtov2.BootSettings

func ParseInterval

func ParseInterval(duration string) (int, error)

func RandomValueHex

func RandomValueHex(length int) (string, error)

func RecordConnectionSetup added in v1.21.0

func RecordConnectionSetup(duration time.Duration, mode string)

RecordConnectionSetup records the TCP connection setup duration metric.

func RecordConsentCodeWait added in v1.21.0

func RecordConsentCodeWait(duration time.Duration, mode string)

RecordConsentCodeWait records the consent code wait time metric.

func RecordDeviceLookup added in v1.21.0

func RecordDeviceLookup(duration time.Duration)

RecordDeviceLookup records the device lookup duration metric.

func RecordTotalConnection added in v1.21.0

func RecordTotalConnection(duration time.Duration, mode string)

RecordTotalConnection records the total KVM connection time metric.

func RecordWebsocketUpgrade added in v1.21.0

func RecordWebsocketUpgrade(duration time.Duration)

RecordWebsocketUpgrade records the WebSocket upgrade duration metric.

func ValidateHTTPBootParams added in v1.9.0

func ValidateHTTPBootParams(url, username, password string) (buffer []byte, paramCount int, err error)

func ValidatePBAWinReBootParams added in v1.9.0

func ValidatePBAWinReBootParams(file string) (buffer []byte, paramCount int, err error)

Types

type AMTError

type AMTError struct {
	Console consoleerrors.InternalError
}

func (AMTError) Error

func (e AMTError) Error() string

func (AMTError) Wrap

func (e AMTError) Wrap(call, function string, err error) error

type BootConfiguration added in v1.39.0

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

type DeviceConnection

type DeviceConnection struct {
	Conn WebSocketConn

	Device    entity.Device
	Direct    bool
	Mode      string
	Challenge client.AuthChallenge
	// contains filtered or unexported fields
}

type ExplorerError

type ExplorerError struct {
	Console consoleerrors.InternalError
}

func (ExplorerError) Error

func (e ExplorerError) Error() string

func (ExplorerError) Wrap

func (e ExplorerError) Wrap(call, function string, err error) error

type Feature

type Feature interface {
	// Repository/Database Calls
	GetCount(context.Context, string) (int, error)
	Get(ctx context.Context, top, skip int, tenantID string) ([]dto.Device, error)
	GetByID(ctx context.Context, guid, tenantID string, includeSecrets bool) (*dto.Device, error)
	// GetByGUID resolves a device without a tenant filter. CIRA devices
	// authenticate by GUID and cannot present a tenant.
	GetByGUID(ctx context.Context, guid string, includeSecrets bool) (*dto.Device, error)
	UpdateConnectionStatus(ctx context.Context, guid string, status bool) error
	UpdateLastSeen(ctx context.Context, guid string) error
	GetDistinctTags(ctx context.Context, tenantID string) ([]string, error)
	GetByTags(ctx context.Context, tags, method string, limit, offset int, tenantID string) ([]dto.Device, error)
	Delete(ctx context.Context, guid, tenantID string) error
	Update(ctx context.Context, d *dto.Device, fields map[string]bool) (*dto.Device, error)
	Insert(ctx context.Context, d *dto.Device) (*dto.Device, error)
	GetByColumn(ctx context.Context, columnName, queryValue, tenantID string) ([]dto.Device, error)
	// GetActivated returns every managed device: anything not currently flagged
	// as still-in-discovery pre-provisioning, including legacy rows with no
	// recorded control mode.
	GetActivated(ctx context.Context, top, skip int, tenantID string) ([]dto.Device, error)
	GetDiscovered(ctx context.Context, top, skip int, tenantID string) ([]dto.Device, error)
	GetDeviceStateCounts(ctx context.Context, tenantID string) (activated, discovered int, err error)
	// Management Calls
	GetVersion(ctx context.Context, guid, tenantID string) (dto.Version, dtov2.Version, error)
	GetFeatures(ctx context.Context, guid, tenantID string) (dto.Features, dtov2.Features, error)
	SetFeatures(ctx context.Context, guid, tenantID string, features dto.Features) (dto.Features, dtov2.Features, error)
	GetAlarmOccurrences(ctx context.Context, guid, tenantID string) ([]dto.AlarmClockOccurrence, error)
	CreateAlarmOccurrences(ctx context.Context, guid, tenantID string, alarm dto.AlarmClockOccurrenceInput) (dto.AddAlarmOutput, error)
	DeleteAlarmOccurrences(ctx context.Context, guid, instanceID, tenantID string) error
	GetHardwareInfo(ctx context.Context, guid, tenantID string) (dto.HardwareInfo, error)
	GetPowerState(ctx context.Context, guid, tenantID string) (dto.PowerState, error)
	GetPowerCapabilities(ctx context.Context, guid, tenantID string) (dto.PowerCapabilities, error)
	GetRemoteEraseCapabilities(ctx context.Context, guid, tenantID string) (dto.BootCapabilities, error)
	SetRemoteEraseOptions(ctx context.Context, guid, tenantID string, req dto.RemoteEraseRequest) error
	GetGeneralSettings(ctx context.Context, guid, tenantID string) (dto.GeneralSettings, error)
	CancelUserConsent(ctx context.Context, guid, tenantID string) (dto.UserConsentMessage, error)
	GetUserConsentCode(ctx context.Context, guid, tenantID string) (dto.UserConsentMessage, error)
	SendConsentCode(ctx context.Context, code dto.UserConsentCode, guid, tenantID string) (dto.UserConsentMessage, error)
	SendPowerAction(ctx context.Context, guid, tenantID string, action int) (power.PowerActionResponse, error)
	SetBootOptions(ctx context.Context, guid, tenantID string, bootSetting dto.BootSetting) (power.PowerActionResponse, error)
	GetAuditLog(ctx context.Context, startIndex int, guid, tenantID string) (dto.AuditLog, error)
	GetEventLog(ctx context.Context, startIndex, maxReadRecords int, guid, tenantID string) (dto.EventLogs, error)
	Redirect(ctx context.Context, conn *websocket.Conn, guid, mode string) error
	GetNetworkSettings(c context.Context, guid, tenantID string) (dto.NetworkSettings, error)
	GetWiredNetworkSettings(c context.Context, guid, tenantID string) (dto.WiredNetworkInfo, error)
	PatchWiredNetworkSettings(c context.Context, guid, tenantID string, req dto.WiredNetworkConfigRequest) error
	RequestWirelessStateChange(c context.Context, guid, tenantID string, requestedState wifi.RequestedState) (wifi.RequestedState, error)
	GetWirelessState(c context.Context, guid, tenantID string) (wifi.EnabledState, error)
	GetWirelessProfileSync(c context.Context, guid, tenantID string) (dto.WirelessProfileSyncResponse, error)
	SetWirelessProfileSync(c context.Context, guid, tenantID string, req dto.WirelessProfileSyncRequest) (dto.WirelessProfileSyncResponse, error)
	GetWirelessProfiles(c context.Context, guid, tenantID string) ([]dto.WirelessProfileResponse, error)
	AddWirelessProfile(c context.Context, guid, tenantID string, profile config.WirelessProfile) error
	DeleteWirelessProfile(c context.Context, guid, profileName, tenantID string) error
	UpdateWirelessProfile(c context.Context, guid, tenantID string, profile config.WirelessProfile) error
	GetCertificates(c context.Context, guid, tenantID string) (dto.SecuritySettings, error)
	GetTLSSettingData(c context.Context, guid, tenantID string) ([]dto.SettingDataResponse, error)
	GetDiskInfo(c context.Context, guid, tenantID string) (dto.DiskInfo, error)
	GetDeviceCertificate(c context.Context, guid, tenantID string) (dto.Certificate, error)
	AddCertificate(c context.Context, guid, tenantID string, certInfo dto.CertInfo) (string, error)
	DeleteCertificate(c context.Context, guid, instanceID, tenantID string) error
	GetBootSourceSetting(c context.Context, guid, tenantID string) ([]dto.BootSources, error)
	// KVM Screen Settings (IPS_ScreenSettingData)
	GetKVMScreenSettings(c context.Context, guid, tenantID string) (dto.KVMScreenSettings, error)
	SetKVMScreenSettings(c context.Context, guid, tenantID string, req dto.KVMScreenSettingsRequest) (dto.KVMScreenSettings, error)
	// Link Preference (AMT_EthernetPortSettings)
	SetLinkPreference(c context.Context, guid, tenantID string, req dto.LinkPreferenceRequest) (dto.LinkPreferenceResponse, error)
}

type IEEE8021xCertHandles added in v1.30.0

type IEEE8021xCertHandles struct {
	ClientCertHandle string
	RootCertHandle   string
}

type NotSupportedError

type NotSupportedError struct {
	Console consoleerrors.InternalError
}

func (NotSupportedError) Error

func (e NotSupportedError) Error() string

func (NotSupportedError) Wrap

func (e NotSupportedError) Wrap(call, function, message string) error

type Redirection

type Redirection interface {
	SetupWsmanClient(ctx context.Context, device entity.Device, isRedirection, logMessages bool) (wsman.Messages, error)
	RedirectConnect(ctx context.Context, deviceConnection *DeviceConnection) error
	RedirectClose(ctx context.Context, deviceConnection *DeviceConnection) error
	RedirectListen(ctx context.Context, deviceConnection *DeviceConnection) ([]byte, error)
	RedirectSend(ctx context.Context, deviceConnection *DeviceConnection, message []byte) error
}

type Redirector

type Redirector struct {
	SafeRequirements security.Cryptor
}

func NewRedirector

func NewRedirector(safeRequirements security.Cryptor) *Redirector

func (*Redirector) RedirectClose

func (g *Redirector) RedirectClose(_ context.Context, deviceConnection *DeviceConnection) error

func (*Redirector) RedirectConnect

func (g *Redirector) RedirectConnect(_ context.Context, deviceConnection *DeviceConnection) error

func (*Redirector) RedirectListen

func (g *Redirector) RedirectListen(_ context.Context, deviceConnection *DeviceConnection) ([]byte, error)

func (*Redirector) RedirectSend

func (g *Redirector) RedirectSend(_ context.Context, deviceConnection *DeviceConnection, data []byte) error

func (*Redirector) SetupWsmanClient

func (g *Redirector) SetupWsmanClient(_ context.Context, device entity.Device, isRedirection, logAMTMessages bool) (wsman.Messages, error)

type Repository

type Repository interface {
	GetCount(context.Context, string) (int, error)
	Get(ctx context.Context, top, skip int, tenantID string) ([]entity.Device, error)
	GetByID(ctx context.Context, guid, tenantID string) (*entity.Device, error)
	GetByGUID(ctx context.Context, guid string) (*entity.Device, error)
	GetDistinctTags(ctx context.Context, tenantID string) ([]string, error)
	GetByTags(ctx context.Context, tags []string, method string, limit, offset int, tenantID string) ([]entity.Device, error)
	Delete(ctx context.Context, guid, tenantID string) (bool, error)
	Update(ctx context.Context, d *entity.Device) (bool, error)
	Insert(ctx context.Context, d *entity.Device) (string, error)
	GetByColumn(ctx context.Context, columnName, queryValue, tenantID string) ([]entity.Device, error)
	// GetActivated returns every managed device: anything not currently flagged
	// as still-in-discovery pre-provisioning, including legacy rows with no
	// recorded control mode.
	GetActivated(ctx context.Context, top, skip int, tenantID string) ([]entity.Device, error)
	GetDiscovered(ctx context.Context, top, skip int, tenantID string) ([]entity.Device, error)
	GetDeviceStateCounts(ctx context.Context, tenantID string) (activated, discovered int, err error)
	UpdateConnectionStatus(ctx context.Context, guid string, status bool) error
	UpdateLastSeen(ctx context.Context, guid string) error
}

type UseCase

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

UseCase -.

func New

func New(r Repository, d WSMAN, redirection Redirection, log logger.Interface, safeRequirements security.Cryptor) *UseCase

New -.

func (*UseCase) AddCertificate

func (uc *UseCase) AddCertificate(c context.Context, guid, tenantID string, certInfo dto.CertInfo) (handle string, err error)

func (*UseCase) AddWirelessProfile added in v1.30.0

func (uc *UseCase) AddWirelessProfile(c context.Context, guid, tenantID string, profile config.WirelessProfile) error

func (*UseCase) CancelUserConsent

func (uc *UseCase) CancelUserConsent(c context.Context, guid, tenantID string) (dto.UserConsentMessage, error)

func (*UseCase) CreateAlarmOccurrences

func (uc *UseCase) CreateAlarmOccurrences(c context.Context, guid, tenantID string, alarm dto.AlarmClockOccurrenceInput) (dto.AddAlarmOutput, error)

func (*UseCase) Delete

func (uc *UseCase) Delete(ctx context.Context, guid, tenantID string) error

func (*UseCase) DeleteAlarmOccurrences

func (uc *UseCase) DeleteAlarmOccurrences(c context.Context, guid, instanceID, tenantID string) error

func (*UseCase) DeleteCertificate added in v1.14.0

func (uc *UseCase) DeleteCertificate(c context.Context, guid, instanceID, tenantID string) error

func (*UseCase) DeleteWirelessProfile added in v1.30.0

func (uc *UseCase) DeleteWirelessProfile(c context.Context, guid, profileName, tenantID string) error

func (*UseCase) Get

func (uc *UseCase) Get(ctx context.Context, top, skip int, tenantID string) ([]dto.Device, error)

func (*UseCase) GetActivated added in v1.45.0

func (uc *UseCase) GetActivated(ctx context.Context, top, skip int, tenantID string) ([]dto.Device, error)

func (*UseCase) GetAlarmOccurrences

func (uc *UseCase) GetAlarmOccurrences(c context.Context, guid, tenantID string) ([]dto.AlarmClockOccurrence, error)

func (*UseCase) GetAuditLog

func (uc *UseCase) GetAuditLog(c context.Context, startIndex int, guid, tenantID string) (dto.AuditLog, error)

func (*UseCase) GetBootSourceSetting added in v1.9.0

func (uc *UseCase) GetBootSourceSetting(c context.Context, guid, tenantID string) ([]dto.BootSources, error)

func (*UseCase) GetByColumn

func (uc *UseCase) GetByColumn(ctx context.Context, columnName, queryValue, tenantID string) ([]dto.Device, error)

func (*UseCase) GetByGUID added in v1.42.0

func (uc *UseCase) GetByGUID(ctx context.Context, guid string, includeSecrets bool) (*dto.Device, error)

GetByGUID resolves a device without a tenant filter, for callers that identify themselves by GUID alone and cannot supply one.

func (*UseCase) GetByID

func (uc *UseCase) GetByID(ctx context.Context, guid, tenantID string, includeSecrets bool) (*dto.Device, error)

func (*UseCase) GetByTags

func (uc *UseCase) GetByTags(ctx context.Context, tags, method string, limit, offset int, tenantID string) ([]dto.Device, error)

func (*UseCase) GetCertificates

func (uc *UseCase) GetCertificates(c context.Context, guid, tenantID string) (dto.SecuritySettings, error)

func (*UseCase) GetCount

func (uc *UseCase) GetCount(ctx context.Context, tenantID string) (int, error)

History - getting translate history from store.

func (*UseCase) GetDeviceCertificate

func (uc *UseCase) GetDeviceCertificate(c context.Context, guid, tenantID string) (dto.Certificate, error)

func (*UseCase) GetDeviceStateCounts added in v1.45.0

func (uc *UseCase) GetDeviceStateCounts(ctx context.Context, tenantID string) (activated, discovered int, err error)

func (*UseCase) GetDiscovered added in v1.45.0

func (uc *UseCase) GetDiscovered(ctx context.Context, top, skip int, tenantID string) ([]dto.Device, error)

func (*UseCase) GetDiskInfo

func (uc *UseCase) GetDiskInfo(c context.Context, guid, tenantID string) (dto.DiskInfo, error)

func (*UseCase) GetDistinctTags

func (uc *UseCase) GetDistinctTags(ctx context.Context, tenantID string) ([]string, error)

func (*UseCase) GetEventLog

func (uc *UseCase) GetEventLog(c context.Context, startIndex, maxReadRecords int, guid, tenantID string) (dto.EventLogs, error)

func (*UseCase) GetFeatures

func (uc *UseCase) GetFeatures(c context.Context, guid, tenantID string) (settingsResults dto.Features, settingsResultsV2 dtov2.Features, err error)

func (*UseCase) GetGeneralSettings

func (uc *UseCase) GetGeneralSettings(c context.Context, guid, tenantID string) (dto.GeneralSettings, error)

func (*UseCase) GetHardwareInfo

func (uc *UseCase) GetHardwareInfo(c context.Context, guid, tenantID string) (dto.HardwareInfo, error)

func (*UseCase) GetKVMScreenSettings added in v1.10.0

func (uc *UseCase) GetKVMScreenSettings(c context.Context, guid, tenantID string) (dto.KVMScreenSettings, error)

GetKVMScreenSettings returns IPS_ScreenSettingData for the device.

func (*UseCase) GetNetworkSettings

func (uc *UseCase) GetNetworkSettings(c context.Context, guid, tenantID string) (dto.NetworkSettings, error)

func (*UseCase) GetPowerCapabilities

func (uc *UseCase) GetPowerCapabilities(c context.Context, guid, tenantID string) (dto.PowerCapabilities, error)

func (*UseCase) GetPowerState

func (uc *UseCase) GetPowerState(c context.Context, guid, tenantID string) (dto.PowerState, error)

func (*UseCase) GetRemoteEraseCapabilities added in v1.39.0

func (uc *UseCase) GetRemoteEraseCapabilities(c context.Context, guid, tenantID string) (dto.BootCapabilities, error)

func (*UseCase) GetTLSSettingData

func (uc *UseCase) GetTLSSettingData(c context.Context, guid, tenantID string) ([]dto.SettingDataResponse, error)

func (*UseCase) GetUserConsentCode

func (uc *UseCase) GetUserConsentCode(c context.Context, guid, tenantID string) (dto.UserConsentMessage, error)

func (*UseCase) GetVersion

func (uc *UseCase) GetVersion(c context.Context, guid, tenantID string) (v1 dto.Version, v2 dtov2.Version, err error)

func (*UseCase) GetWiredNetworkSettings added in v1.35.0

func (uc *UseCase) GetWiredNetworkSettings(c context.Context, guid, tenantID string) (dto.WiredNetworkInfo, error)

GetWiredNetworkSettings returns the wired (Intel® AMT Ethernet Port Settings 0) portion of a device's network settings.

func (*UseCase) GetWirelessProfileSync added in v1.36.0

func (uc *UseCase) GetWirelessProfileSync(c context.Context, guid, tenantID string) (dto.WirelessProfileSyncResponse, error)

func (*UseCase) GetWirelessProfiles added in v1.30.0

func (uc *UseCase) GetWirelessProfiles(c context.Context, guid, tenantID string) ([]dto.WirelessProfileResponse, error)

func (*UseCase) GetWirelessState added in v1.24.0

func (uc *UseCase) GetWirelessState(c context.Context, guid, tenantID string) (wifi.EnabledState, error)

func (*UseCase) Insert

func (uc *UseCase) Insert(ctx context.Context, d *dto.Device) (*dto.Device, error)

func (*UseCase) ListenToBrowser

func (uc *UseCase) ListenToBrowser(deviceConnection *DeviceConnection)

func (*UseCase) ListenToDevice

func (uc *UseCase) ListenToDevice(deviceConnection *DeviceConnection)

func (*UseCase) MonitorConnectionHealth added in v1.8.5

func (uc *UseCase) MonitorConnectionHealth(deviceConnection *DeviceConnection, key string)

func (*UseCase) PatchWiredNetworkSettings added in v1.35.0

func (uc *UseCase) PatchWiredNetworkSettings(c context.Context, guid, tenantID string, req dto.WiredNetworkConfigRequest) error

PatchWiredNetworkSettings updates a device's wired IPv4 configuration (DHCP or static IP). It returns no content on success.

func (*UseCase) Redirect

func (uc *UseCase) Redirect(c context.Context, conn *websocket.Conn, guid, mode string) error

func (*UseCase) RequestWirelessStateChange added in v1.24.0

func (uc *UseCase) RequestWirelessStateChange(c context.Context, guid, tenantID string, requestedState wifi.RequestedState) (wifi.RequestedState, error)

func (*UseCase) SendConsentCode

func (uc *UseCase) SendConsentCode(c context.Context, userConsent dto.UserConsentCode, guid, tenantID string) (dto.UserConsentMessage, error)

func (*UseCase) SendPowerAction

func (uc *UseCase) SendPowerAction(c context.Context, guid, tenantID string, action int) (power.PowerActionResponse, error)

func (*UseCase) SetBootOptions

func (uc *UseCase) SetBootOptions(c context.Context, guid, tenantID string, bootSetting dto.BootSetting) (power.PowerActionResponse, error)

func (*UseCase) SetFeatures

func (uc *UseCase) SetFeatures(c context.Context, guid, tenantID string, features dto.Features) (settingsResults dto.Features, settingsResultsV2 dtov2.Features, err error)

func (*UseCase) SetKVMScreenSettings added in v1.10.0

func (uc *UseCase) SetKVMScreenSettings(c context.Context, guid, tenantID string, reqData dto.KVMScreenSettingsRequest) (dto.KVMScreenSettings, error)

SetKVMScreenSettings updates IPS_ScreenSettingData; currently not supported via wsman lib We accept payload but return NotSupported to preserve API contract for future.

func (*UseCase) SetLinkPreference added in v1.17.0

func (uc *UseCase) SetLinkPreference(c context.Context, guid, tenantID string, req dto.LinkPreferenceRequest) (dto.LinkPreferenceResponse, error)

SetLinkPreference sets the link preference (ME or Host) on a device's WiFi interface.

func (*UseCase) SetRemoteEraseOptions added in v1.39.0

func (uc *UseCase) SetRemoteEraseOptions(c context.Context, guid, tenantID string, req dto.RemoteEraseRequest) error

func (*UseCase) SetWirelessProfileSync added in v1.36.0

func (uc *UseCase) SetWirelessProfileSync(c context.Context, guid, tenantID string, req dto.WirelessProfileSyncRequest) (dto.WirelessProfileSyncResponse, error)

func (*UseCase) Update

func (uc *UseCase) Update(ctx context.Context, d *dto.Device, fields map[string]bool) (*dto.Device, error)

Update persists d. fields == nil writes d as-is; non-nil merges only the listed JSON keys onto the existing record.

func (*UseCase) UpdateConnectionStatus added in v1.22.3

func (uc *UseCase) UpdateConnectionStatus(ctx context.Context, guid string, status bool) error

func (*UseCase) UpdateLastSeen added in v1.22.3

func (uc *UseCase) UpdateLastSeen(ctx context.Context, guid string) error

func (*UseCase) UpdateWirelessProfile added in v1.30.0

func (uc *UseCase) UpdateWirelessProfile(c context.Context, guid, tenantID string, profile config.WirelessProfile) error

type ValidationError

type ValidationError struct {
	Console consoleerrors.InternalError
}

func (ValidationError) Error

func (e ValidationError) Error() string

func (ValidationError) Wrap

func (e ValidationError) Wrap(call, function, message string) error

type WSMAN

type WSMAN interface {
	SetupWsmanClient(ctx context.Context, device entity.Device, isRedirection, logMessages bool) (wsmanAPI.Management, error)
	DestroyWsmanClient(device dto.Device)
	Worker()
}

type WebSocketConn

type WebSocketConn interface {
	ReadMessage() (int, []byte, error)
	WriteMessage(messageType int, data []byte) error
	Close() error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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