Initial commit
This commit is contained in:
commit
89f483171a
43 changed files with 2245 additions and 0 deletions
23
section.go
Normal file
23
section.go
Normal 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
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue