1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- package util
- import (
- "sort"
- "k8s.io/kubernetes/pkg/apis/flowcontrol"
- )
- var _ sort.Interface = FlowSchemaSequence{}
- type FlowSchemaSequence []*flowcontrol.FlowSchema
- func (s FlowSchemaSequence) Len() int {
- return len(s)
- }
- func (s FlowSchemaSequence) Less(i, j int) bool {
-
- if ip, jp := s[i].Spec.MatchingPrecedence, s[j].Spec.MatchingPrecedence; ip != jp {
- return ip < jp
- }
-
- return s[i].Name < s[j].Name
- }
- func (s FlowSchemaSequence) Swap(i, j int) {
- s[i], s[j] = s[j], s[i]
- }
|