github.com/wtfutil/wtf@v0.43.0/modules/pagerduty/sort.go (about)

     1  package pagerduty
     2  
     3  import "github.com/PagerDuty/go-pagerduty"
     4  
     5  type ByEscalationLevel []pagerduty.OnCall
     6  
     7  func (s ByEscalationLevel) Len() int      { return len(s) }
     8  func (s ByEscalationLevel) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
     9  
    10  func (s ByEscalationLevel) Less(i, j int) bool {
    11  	return s[i].EscalationLevel < s[j].EscalationLevel
    12  }