system

package
v2.0.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GetBIOSSerialNumberRequest

type GetBIOSSerialNumberRequest struct {
}

type GetBIOSSerialNumberResponse

type GetBIOSSerialNumberResponse struct {
	// Serial number
	SerialNumber string
}

type GetServiceRequest

type GetServiceRequest struct {
	// Service name (as listed in System\CCS\Services keys)
	Name string
}

type GetServiceResponse

type GetServiceResponse struct {
	// Service display name
	DisplayName string

	// Service start type
	// Used to control whether a service will start on boot, and if so on which
	// boot phase
	StartType Startype

	// Service status, e.g. stopped, running, paused
	Status ServiceStatus
}

type Interface

type Interface interface {
	// GetBIOSSerialNumber returns the device's serial number
	GetBIOSSerialNumber(context.Context, *GetBIOSSerialNumberRequest) (*GetBIOSSerialNumberResponse, error)

	// GetService queries a Windows service state
	GetService(context.Context, *GetServiceRequest) (*GetServiceResponse, error)

	// StartService starts a Windows service
	// NOTE: This method affects global node state and should only be used
	//       with consideration to other CSI drivers that run concurrently.
	StartService(context.Context, *StartServiceRequest) (*StartServiceResponse, error)

	// StopService stops a Windows service
	// NOTE: This method affects global node state and should only be used
	//       with consideration to other CSI drivers that run concurrently.
	StopService(context.Context, *StopServiceRequest) (*StopServiceResponse, error)
}

type ServiceStatus

type ServiceStatus uint32
const (
	SERVICE_STATUS_UNKNOWN ServiceStatus = iota
	SERVICE_STATUS_STOPPED
	SERVICE_STATUS_START_PENDING
	SERVICE_STATUS_STOP_PENDING
	SERVICE_STATUS_RUNNING
	SERVICE_STATUS_CONTINUE_PENDING
	SERVICE_STATUS_PAUSE_PENDING
	SERVICE_STATUS_PAUSED
)

https://docs.microsoft.com/en-us/windows/win32/api/winsvc/ns-winsvc-service_status#members

type StartServiceRequest

type StartServiceRequest struct {
	// Service name (as listed in System\CCS\Services keys)
	Name string
}

type StartServiceResponse

type StartServiceResponse struct {
}

type Startype

type Startype uint32
const (
	START_TYPE_BOOT Startype = iota
	START_TYPE_SYSTEM
	START_TYPE_AUTOMATIC
	START_TYPE_MANUAL
	START_TYPE_DISABLED
)

https://docs.microsoft.com/en-us/windows/win32/api/winsvc/nf-winsvc-changeserviceconfiga

type StopServiceRequest

type StopServiceRequest struct {
	// Service name (as listed in System\CCS\Services keys)
	Name string

	// Forces stopping of services that has dependent services
	Force bool
}

type StopServiceResponse

type StopServiceResponse struct {
}

type System

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

func New

func New(hostAPI systemapi.HostAPI) (*System, error)

func (*System) GetBIOSSerialNumber

func (s *System) GetBIOSSerialNumber(context context.Context, request *GetBIOSSerialNumberRequest) (*GetBIOSSerialNumberResponse, error)

func (*System) GetService

func (s *System) GetService(context context.Context, request *GetServiceRequest) (*GetServiceResponse, error)

func (*System) StartService

func (s *System) StartService(context context.Context, request *StartServiceRequest) (*StartServiceResponse, error)

func (*System) StopService

func (s *System) StopService(context context.Context, request *StopServiceRequest) (*StopServiceResponse, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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