Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( L = map[string]T{ "titles": OrderingTitles, "queued": OrderingQueued, "score": OrderingScore, "corpus": OrderingCorpus, } F = map[T]C{ OrderingTitles: func(a *dpb.Entry, b *dpb.Entry) int { var at string var bt string if len(a.GetTitles()) > 0 { at = strings.ToLower(a.GetTitles()[0]) } if len(b.GetTitles()) > 0 { bt = strings.ToLower(b.GetTitles()[0]) } return strings.Compare(at, bt) }, OrderingCorpus: func(a *dpb.Entry, b *dpb.Entry) int { return strings.Compare(a.GetCorpus().String(), b.GetCorpus().String()) }, OrderingQueued: func(a *dpb.Entry, b *dpb.Entry) int { if a.GetQueued() && !b.GetQueued() { return -1 } if b.GetQueued() && !a.GetQueued() { return 1 } return 0 }, OrderingScore: func(a *dpb.Entry, b *dpb.Entry) int { if a.GetScore() > b.GetScore() { return -1 } if a.GetScore() < b.GetScore() { return 1 } return 0 }, } )
Functions ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.