backend

package
v0.0.0-...-38640dd Latest Latest
Warning

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

Go to latest
Published: May 11, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	Log               *logrus.Logger
	Driver            *api.Driver
	DeviceInformation DeviceInformationJson
	AvaliableDevices  map[string]DeviceInformationJson
	// contains filtered or unexported fields
}

App struct

func NewApp

func NewApp() *App

NewApp creates a new App application struct

func (*App) BeforeClose

func (a *App) BeforeClose(ctx context.Context) (prevent bool)

beforeClose is called when the application is about to quit, either by clicking the window close button or calling runtime.Quit. Returning true will cause the application to continue, false will continue shutdown as normal.

func (*App) DomReady

func (a *App) DomReady(ctx context.Context)

domReady is called after the front-end dom has been loaded

func (*App) GetDeviceInformation

func (a *App) GetDeviceInformation()

func (*App) LoadAvaliableDevices

func (a *App) LoadAvaliableDevices() []DeviceInformationJson

func (*App) LoadDevices

func (a *App) LoadDevices(ctx context.Context)

func (*App) LoadDevicesPolling

func (a *App) LoadDevicesPolling() error

func (*App) SelectDevice

func (a *App) SelectDevice(checksum string) error

func (*App) SetButtonWrapper

func (a *App) SetButtonWrapper(button_type string, new_value string)

func (*App) SetDpiWrapper

func (a *App) SetDpiWrapper(dpi int)

func (*App) SetLEDWrapper

func (a *App) SetLEDWrapper(ledhex string)

func (*App) Shutdown

func (a *App) Shutdown(ctx context.Context)

shutdown is called at application termination

func (*App) Startup

func (a *App) Startup(ctx context.Context)

startup is called at application startup

func (*App) UpdateAvaliableDevices

func (a *App) UpdateAvaliableDevices(dij []DeviceInformationJson)

type DeviceInformationJson

type DeviceInformationJson struct {
	Path         string          `json:"path"`
	VendorID     uint16          `json:"vendor_id"`
	ProductID    uint16          `json:"product_id"`
	Serial       string          `json:"serial"`
	Manufacturer string          `json:"manufacturer"`
	Product      string          `json:"product"`
	Interface    int             `json:"interface"`
	Hash         string          `json:"checksum"`
	DeviceInfo   *hid.DeviceInfo // Keep this in memory first to open a device easily
}

func (*DeviceInformationJson) ParseFromHidLib

func (d *DeviceInformationJson) ParseFromHidLib(di *hid.DeviceInfo)

type MouseInformationStruct

type MouseInformationStruct struct {
	Dpi                 uint16 `json:"dpi"`
	CurrentBackButton   string `json:"back_button"`
	CurrentFrontButton  string `json:"front_button"`
	CurrentMiddleButton string `json:"middle_button"`
	LedColor            string `json:"led"`
}

func (*MouseInformationStruct) Init

func (m *MouseInformationStruct) Init(d *api.Driver)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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