registry

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2025 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventCustomAllDevicesSent    = CustomEventType(0)
	EventCustomTransferAuthority = CustomEventType(1)
)

Variables

View Source
var (
	ErrCouldNotGetInputDeviceStatistics   = errors.New("could not get input device statistics")
	ErrCouldNotCreateNewDevice            = errors.New("could not create new device")
	ErrCouldNotSendDeviceInfo             = errors.New("could not send device info")
	ErrCouldNotSendEvent                  = errors.New("could not send event")
	ErrCouldNotMigrate                    = errors.New("could not migrate")
	ErrCouldNotContinueWithMigration      = errors.New("could not continue with migration")
	ErrCouldNotHandleProtocol             = errors.New("could not handle protocol")
	ErrCouldNotHandleNeedAt               = errors.New("could not handle NeedAt")
	ErrCouldNotHandleDontNeedAt           = errors.New("could not handle DontNeedAt")
	ErrCouldNotCreateMigrator             = errors.New("could not create migrator")
	ErrCouldNotWaitForMigrationCompletion = errors.New("could not wait for migration completion")
)

Functions

func MigrateTo

func MigrateTo(
	ctx context.Context,

	openedDevices []OpenedRegistryDevice,
	concurrency int,

	readers []io.Reader,
	writers []io.Writer,

	hooks MigrateToHooks,
) (errs error)

Types

type CustomEventType

type CustomEventType byte

type MigrateToHooks

type MigrateToHooks struct {
	OnDeviceSent               func(deviceID uint32)
	OnDeviceAuthoritySent      func(deviceID uint32)
	OnDeviceMigrationProgress  func(deviceID uint32, ready int, total int)
	OnDeviceMigrationCompleted func(deviceID uint32)

	OnAllDevicesSent         func()
	OnAllMigrationsCompleted func()
}

type OpenDevicesHooks

type OpenDevicesHooks struct {
	OnDeviceOpened func(deviceID uint32, name string)
}

type OpenedRegistryDevice

type OpenedRegistryDevice struct {
	RegistryDevice RegistryDevice
	// contains filtered or unexported fields
}

func OpenDevices

func OpenDevices(
	devices []RegistryDevice,

	hooks OpenDevicesHooks,
) ([]OpenedRegistryDevice, []func() error, error)

type RegistryDevice

type RegistryDevice struct {
	Name      string `json:"name"`
	Input     string `json:"input"`
	BlockSize uint32 `json:"blockSize"`
}

Jump to

Keyboard shortcuts

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