gostart/page.go

29 lines
570 B
Go
Raw Normal View History

2022-11-29 19:55:00 -07:00
package main
import (
"sort"
"suah.dev/gostart/data"
"tailscale.com/tailcfg"
)
type Page struct {
Title string
System data.Owner
2022-11-29 19:55:00 -07:00
PullRequests []data.PullRequest
Links []data.Link
Node tailcfg.Node
CurrentLimits *RateLimit
2022-12-04 19:03:59 -07:00
Ignores []data.PullRequestIgnore
2022-12-06 20:03:32 -07:00
Watches *WatchResults
2022-11-29 19:55:00 -07:00
}
func (p *Page) Sort() {
sort.Slice(p.Links, func(i, j int) bool {
2022-12-02 20:53:05 -07:00
return p.Links[i].Name < p.Links[j].Name
2022-11-29 19:55:00 -07:00
})
sort.Slice(p.PullRequests, func(i, j int) bool {
return p.PullRequests[i].Number > p.PullRequests[j].Number
})
}