joyful/internal/config/schema.go
Anna Rose Wiggins ff38db6596 Big Refactor (#2)
Refactor Everything.

Co-authored-by: Anna Rose Wiggins <annabunches@gmail.com>
Co-committed-by: Anna Rose Wiggins <annabunches@gmail.com>
2025-07-08 03:26:24 +00:00

38 lines
1.3 KiB
Go

// These types comprise the YAML schema for configuring Joyful.
// The config files will be combined and then unmarshalled into this
package config
type Config struct {
Devices []DeviceConfig `yaml:"devices"`
Modes []string `yaml:"modes,omitempty"`
Rules []RuleConfig `yaml:"rules"`
}
type DeviceConfig struct {
Name string `yaml:"name"`
Type string `yaml:"type"`
DeviceName string `yaml:"device_name,omitempty"`
Uuid string `yaml:"uuid,omitempty"`
Buttons int `yaml:"buttons,omitempty"`
Axes int `yaml:"axes,omitempty"`
}
type RuleConfig struct {
Name string `yaml:"name,omitempty"`
Type string `yaml:"type"`
Input RuleTargetConfig `yaml:"input,omitempty"`
Inputs []RuleTargetConfig `yaml:"inputs,omitempty"`
Output RuleTargetConfig `yaml:"output"`
Modes []string `yaml:"modes,omitempty"`
}
type RuleTargetConfig struct {
Device string `yaml:"device,omitempty"`
Button string `yaml:"button,omitempty"`
Axis string `yaml:"axis,omitempty"`
DeadzoneStart int32 `yaml:"axis_start,omitempty"`
DeadzoneEnd int32 `yaml:"axis_end,omitempty"`
Inverted bool `yaml:"inverted,omitempty"`
Modes []string `yaml:"modes,omitempty"`
}