gitee.com/lonely0422/gometalinter.git@v3.0.1-0.20190307123442-32416ab75314+incompatible/_linters/src/github.com/nbutton23/zxcvbn-go/match/match.go (about)

     1  package match
     2  
     3  type Matches []Match
     4  
     5  func (s Matches) Len() int {
     6  	return len(s)
     7  }
     8  func (s Matches) Swap(i, j int) {
     9  	s[i], s[j] = s[j], s[i]
    10  }
    11  func (s Matches) Less(i, j int) bool {
    12  	if s[i].I < s[j].I {
    13  		return true
    14  	} else if s[i].I == s[j].I {
    15  		return s[i].J < s[j].J
    16  	} else {
    17  		return false
    18  	}
    19  }
    20  
    21  type Match struct {
    22  	Pattern        string
    23  	I, J           int
    24  	Token          string
    25  	DictionaryName string
    26  	Entropy        float64
    27  }
    28  
    29  type DateMatch struct {
    30  	Pattern          string
    31  	I, J             int
    32  	Token            string
    33  	Separator        string
    34  	Day, Month, Year int64
    35  }
    36  
    37  type Matcher struct {
    38  	MatchingFunc func(password string) []Match
    39  	ID           string
    40  }