Initial commit

This commit is contained in:
eleksir
2024-03-12 23:14:55 +03:00
commit 74eaf3bd75
634 changed files with 259702 additions and 0 deletions

31
types.go Normal file
View File

@@ -0,0 +1,31 @@
package main
type Config struct {
// LoopDelay in milliseconds - whole set of action delay period.
LoopDelay int `yaml:"loop_delay"`
// CmdDelay in milliseconds - delay between each change application.
CmdDelay int `yaml:"cmd_delay"`
// Whether to print debug info on stdout.
Debug bool `yaml:"debug,omitempty"`
// В гошке yaml не позволяет сделать удобный парсер для конструкций, аналогичных json-овскому
// {kill:{"stop":["proc1","proc2"], "term":["proc3","proc4"]}}
// Поэтому мы просто возьмём массив и каждому элементу добавим тип сигнала.
Kill Kill `yaml:"kill,omitempty"`
Prio Prio `yaml:"prio,omitempty"`
}
type Prio []struct {
Nice int32 `yaml:"nice,omitempty"`
Name []string `yaml:"name,omitempty"`
}
type Kill []struct {
Sig string `yaml:"sig,omitempty"`
Name []string `yaml:"name,omitempty"`
}
/* vim: set ft=go noet ai ts=4 sw=4 sts=4: */