Add separate sort options for convenience

Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
This commit is contained in:
Vartan Benohanian
2020-07-28 11:01:50 -04:00
parent ff682a6e70
commit 2eb02e7df6
4 changed files with 53 additions and 52 deletions
-33
View File
@@ -22,39 +22,6 @@ const (
kindModAction = "modaction"
)
// Sort is a sorting option.
type Sort int
var sorts = [...]string{
"hot",
"best",
"new",
"rising",
"controversial",
"top",
"relevance",
"comments",
}
// Different sorting options.
const (
SortHot Sort = iota
SortBest
SortNew
SortRising
SortControversial
SortTop
SortRelevance
SortComments
)
func (s Sort) String() string {
if s < SortHot || s > SortComments {
return ""
}
return sorts[s]
}
// Permalink is the link to a post or comment.
type Permalink string