bouncer/internal/store/sort.go
William Petit e66938f1d3
All checks were successful
Cadoles/bouncer/pipeline/head This commit looks good
feat: initial commit
2023-05-21 22:27:25 +02:00

14 lines
510 B
Go

package store
type ByProxyWeight []*ProxyHeader
func (s ByProxyWeight) Len() int { return len(s) }
func (s ByProxyWeight) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
func (s ByProxyWeight) Less(i, j int) bool { return s[i].Weight > s[j].Weight }
type ByLayerWeight []*LayerHeader
func (s ByLayerWeight) Len() int { return len(s) }
func (s ByLayerWeight) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
func (s ByLayerWeight) Less(i, j int) bool { return s[i].Weight > s[j].Weight }