Documentation ¶
Index ¶
- Constants
- Variables
- func RandomValueHex(length int) (string, error)
- type AMTError
- type DeviceConnection
- type Feature
- type Management
- type Redirection
- type Redirector
- func (g *Redirector) RedirectClose(_ context.Context, deviceConnection *DeviceConnection) error
- func (g *Redirector) RedirectConnect(_ context.Context, deviceConnection *DeviceConnection) error
- func (g *Redirector) RedirectListen(_ context.Context, deviceConnection *DeviceConnection) ([]byte, error)
- func (g *Redirector) RedirectSend(_ context.Context, deviceConnection *DeviceConnection, data []byte) error
- func (g *Redirector) SetupWsmanClient(device dto.Device, isRedirection, logAMTMessages bool) wsman.Messages
- type Repository
- type UseCase
- func (uc *UseCase) CancelUserConsent(c context.Context, guid string) (interface{}, error)
- func (uc *UseCase) CreateAlarmOccurrences(c context.Context, guid string, alarm dto.AlarmClockOccurrence) (amtAlarmClock.AddAlarmOutput, error)
- func (uc *UseCase) Delete(ctx context.Context, guid, tenantID string) error
- func (uc *UseCase) DeleteAlarmOccurrences(c context.Context, guid, instanceID string) error
- func (uc *UseCase) Get(ctx context.Context, top, skip int, tenantID string) ([]dto.Device, error)
- func (uc *UseCase) GetAlarmOccurrences(c context.Context, guid string) ([]alarmclock.AlarmClockOccurrence, error)
- func (uc *UseCase) GetAuditLog(c context.Context, startIndex int, guid string) (dto.AuditLog, error)
- func (uc *UseCase) GetByID(ctx context.Context, guid, tenantID string) (*dto.Device, error)
- func (uc *UseCase) GetByTags(ctx context.Context, tags, method string, limit, offset int, tenantID string) ([]dto.Device, error)
- func (uc *UseCase) GetCount(ctx context.Context, tenantID string) (int, error)
- func (uc *UseCase) GetDistinctTags(ctx context.Context, tenantID string) ([]string, error)
- func (uc *UseCase) GetEventLog(c context.Context, guid string) ([]dto.EventLog, error)
- func (uc *UseCase) GetFeatures(c context.Context, guid string) (interface{}, error)
- func (uc *UseCase) GetGeneralSettings(c context.Context, guid string) (interface{}, error)
- func (uc *UseCase) GetHardwareInfo(c context.Context, guid string) (interface{}, error)
- func (uc *UseCase) GetNetworkSettings(c context.Context, guid string) (interface{}, error)
- func (uc *UseCase) GetPowerCapabilities(c context.Context, guid string) (map[string]interface{}, error)
- func (uc *UseCase) GetPowerState(c context.Context, guid string) (map[string]interface{}, error)
- func (uc *UseCase) GetUserConsentCode(c context.Context, guid string) (map[string]interface{}, error)
- func (uc *UseCase) GetVersion(c context.Context, guid string) (map[string]interface{}, error)
- func (uc *UseCase) Insert(ctx context.Context, d *dto.Device) (*dto.Device, error)
- func (uc *UseCase) Redirect(c context.Context, conn *websocket.Conn, guid, mode string) error
- func (uc *UseCase) SendConsentCode(c context.Context, userConsent dto.UserConsent, guid string) (interface{}, error)
- func (uc *UseCase) SendPowerAction(c context.Context, guid string, action int) (power.PowerActionResponse, error)
- func (uc *UseCase) SetBootOptions(c context.Context, guid string, bootSetting dto.BootSetting) (power.PowerActionResponse, error)
- func (uc *UseCase) SetFeatures(c context.Context, guid string, features dto.Features) (dto.Features, error)
- func (uc *UseCase) Update(ctx context.Context, d *dto.Device) (*dto.Device, error)
Constants ¶
View Source
const ( HeaderByteSize = 9 ContentLengthPadding = 8 RedirectSessionLengthBytes = 13 RedirectionSessionReply = 4 )
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 ( ErrDomainsUseCase = consoleerrors.CreateConsoleError("DevicesUseCase") ErrDatabase = sqldb.DatabaseError{Console: consoleerrors.CreateConsoleError("DevicesUseCase")} ErrNotFound = sqldb.NotFoundError{Console: consoleerrors.CreateConsoleError("DevicesUseCase")} )
Functions ¶
func RandomValueHex ¶
RandomValueHex generates a random hexadecimal string of the specified length.
Types ¶
type AMTError ¶
type AMTError struct {
Console consoleerrors.InternalError
}
type DeviceConnection ¶
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) (*dto.Device, 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) (*dto.Device, error) Insert(ctx context.Context, d *dto.Device) (*dto.Device, error) // Management Calls GetVersion(ctx context.Context, guid string) (map[string]interface{}, error) GetFeatures(ctx context.Context, guid string) (interface{}, error) SetFeatures(ctx context.Context, guid string, features dto.Features) (dto.Features, error) GetAlarmOccurrences(ctx context.Context, guid string) ([]alarmclock.AlarmClockOccurrence, error) CreateAlarmOccurrences(ctx context.Context, guid string, alarm dto.AlarmClockOccurrence) (amtAlarmClock.AddAlarmOutput, error) DeleteAlarmOccurrences(ctx context.Context, guid, instanceID string) error GetHardwareInfo(ctx context.Context, guid string) (interface{}, error) GetPowerState(ctx context.Context, guid string) (map[string]interface{}, error) GetPowerCapabilities(ctx context.Context, guid string) (map[string]interface{}, error) GetGeneralSettings(ctx context.Context, guid string) (interface{}, error) CancelUserConsent(ctx context.Context, guid string) (interface{}, error) GetUserConsentCode(ctx context.Context, guid string) (map[string]interface{}, error) SendConsentCode(ctx context.Context, code dto.UserConsent, guid string) (interface{}, error) SendPowerAction(ctx context.Context, guid string, action int) (power.PowerActionResponse, error) SetBootOptions(ctx context.Context, guid string, bootSetting dto.BootSetting) (power.PowerActionResponse, error) GetAuditLog(ctx context.Context, startIndex int, guid string) (dto.AuditLog, error) GetEventLog(ctx context.Context, guid string) ([]dto.EventLog, error) Redirect(ctx context.Context, conn *websocket.Conn, guid, mode string) error GetNetworkSettings(c context.Context, guid string) (interface{}, error) }
type Management ¶
type Management interface { SetupWsmanClient(device dto.Device, isRedirection, logAMTMessages bool) GetAMTVersion() ([]software.SoftwareIdentity, error) GetSetupAndConfiguration() ([]setupandconfiguration.SetupAndConfigurationServiceResponse, error) GetFeatures() (interface{}, error) SetFeatures(dto.Features) (dto.Features, error) GetAlarmOccurrences() ([]alarmclock.AlarmClockOccurrence, error) CreateAlarmOccurrences(name string, startTime time.Time, interval int, deleteOnCompletion bool) (amtAlarmClock.AddAlarmOutput, error) DeleteAlarmOccurrences(instanceID string) error GetHardwareInfo() (interface{}, error) GetPowerState() ([]service.CIM_AssociatedPowerManagementService, error) GetPowerCapabilities() (boot.BootCapabilitiesResponse, error) GetGeneralSettings() (interface{}, error) CancelUserConsentRequest() (interface{}, error) GetUserConsentCode() (optin.StartOptIn_OUTPUT, error) SendConsentCode(code int) (interface{}, error) SendPowerAction(action int) (power.PowerActionResponse, error) GetBootData() (boot.BootCapabilitiesResponse, error) SetBootData(data boot.BootSettingDataRequest) (interface{}, error) SetBootConfigRole(role int) (interface{}, error) ChangeBootOrder(bootSource string) (cimBoot.ChangeBootOrder_OUTPUT, error) GetAuditLog(startIndex int) (auditlog.Response, error) GetEventLog() (messagelog.GetRecordsResponse, error) GetNetworkSettings() (interface{}, error) GetCredentialRelationships() (credential.Items, error) GetConcreteDependencies() ([]concrete.ConcreteDependency, error) }
type Redirection ¶
type Redirection interface { SetupWsmanClient(device dto.Device, isRedirection, logAMTMessages bool) wsman.Messages 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{}
func NewRedirector ¶
func NewRedirector() *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 ¶
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) 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) }
type UseCase ¶
type UseCase struct {
// contains filtered or unexported fields
}
UseCase -.
func New ¶
func New(r Repository, d Management, redirection Redirection, log logger.Interface) *UseCase
New -.
func (*UseCase) CancelUserConsent ¶
func (*UseCase) CreateAlarmOccurrences ¶
func (uc *UseCase) CreateAlarmOccurrences(c context.Context, guid string, alarm dto.AlarmClockOccurrence) (amtAlarmClock.AddAlarmOutput, error)
func (*UseCase) DeleteAlarmOccurrences ¶
func (*UseCase) GetAlarmOccurrences ¶
func (uc *UseCase) GetAlarmOccurrences(c context.Context, guid string) ([]alarmclock.AlarmClockOccurrence, error)
func (*UseCase) GetAuditLog ¶
func (*UseCase) GetDistinctTags ¶
func (*UseCase) GetEventLog ¶
func (*UseCase) GetFeatures ¶
func (*UseCase) GetGeneralSettings ¶
func (*UseCase) GetHardwareInfo ¶
func (*UseCase) GetNetworkSettings ¶
func (*UseCase) GetPowerCapabilities ¶
func (*UseCase) GetPowerState ¶
func (*UseCase) GetUserConsentCode ¶
func (*UseCase) GetVersion ¶
func (*UseCase) SendConsentCode ¶
func (*UseCase) SendPowerAction ¶
func (*UseCase) SetBootOptions ¶
func (uc *UseCase) SetBootOptions(c context.Context, guid string, bootSetting dto.BootSetting) (power.PowerActionResponse, error)
func (*UseCase) SetFeatures ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.