Initial config parsing code.
This commit is contained in:
parent
33837895d9
commit
02c8642ead
5 changed files with 179 additions and 1 deletions
41
internal/config/types.go
Normal file
41
internal/config/types.go
Normal file
|
@ -0,0 +1,41 @@
|
|||
package config
|
||||
|
||||
type Config struct {
|
||||
Devices DevicesConfig `yaml:"devices"`
|
||||
Rules []RuleConfig `yaml:"rules"`
|
||||
}
|
||||
|
||||
type DevicesConfig struct {
|
||||
Physical []PhysicalDeviceConfig `yaml:"physical"`
|
||||
Virtual []VirtualDeviceConfig `yaml:"virtual"`
|
||||
}
|
||||
|
||||
type PhysicalDeviceConfig struct {
|
||||
Name string `yaml:"name"`
|
||||
Uuid string `yaml:"uuid"`
|
||||
}
|
||||
|
||||
type VirtualDeviceConfig struct {
|
||||
NumButtons int `yaml:"num_buttons"`
|
||||
NumAxes int `yaml:"num_axes"`
|
||||
}
|
||||
|
||||
type RuleConfig struct {
|
||||
Type string `yaml:"type"`
|
||||
Input RuleInputConfig `yaml:"input"`
|
||||
Output RuleOutputConfig `yaml:"output"`
|
||||
}
|
||||
|
||||
type RuleInputConfig struct {
|
||||
Device string `yaml:"device"`
|
||||
Button string `yaml:"button,omitempty"`
|
||||
Buttons []string `yaml:"buttons,omitempty"`
|
||||
Axis string `yaml:"axis,omitempty"`
|
||||
Inverted bool `yaml:"inverted,omitempty"`
|
||||
}
|
||||
|
||||
type RuleOutputConfig struct {
|
||||
Device string `yaml:"device"`
|
||||
Button string `yaml:"button,omitempty"`
|
||||
Axis string `yaml:"axis,omitempty"`
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue