Initial commit

This commit is contained in:
Magnus Åhall 2024-04-29 08:36:13 +02:00
commit 89f483171a
43 changed files with 2245 additions and 0 deletions

23
section.go Normal file
View file

@ -0,0 +1,23 @@
package main
import (
// Standard
"sort"
)
type Section struct {
ID int
Name string
AreaID int `db:"area_id"`
Area Area
Triggers []Trigger
}
func (s *Section) SortedTriggers() []Trigger {
sort.SliceStable(s.Triggers, func(i, j int) bool {
return s.Triggers[i].Name < s.Triggers[j].Name
})
return s.Triggers
}