generated from pterm/cli-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmodules.go
72 lines (64 loc) · 2.24 KB
/
modules.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
package modules
import (
"sort"
"strings"
)
func init() {
// Sort the modules by the first tag.
sort.Slice(Modules, func(i, j int) bool {
return Modules[i].Tags[0] < Modules[j].Tags[0]
})
}
type Module struct {
Name string `json:"name"`
Path string `json:"path"`
Tags Tags `json:"tags"`
}
var Modules = []Module{
{"cobra", "github.com/spf13/cobra", Tags{CLI}},
{"pterm", "github.com/pterm/pterm", Tags{CLI}},
{"survey", "github.com/AlecAivazis/survey/v2", Tags{CLI}},
{"fyne", "github.com/fyne-io/fyne/v2", Tags{GUI}},
{"webview", "github.com/webview/webview", Tags{GUI}},
{"logrus", "github.com/sirupsen/logrus", Tags{LOGGING}},
{"zap", "go.uber.org/zap", Tags{LOGGING}},
{"zerolog", "github.com/rs/zerolog/log", Tags{LOGGING}},
{"gorm", "github.com/go-gorm/gorm", Tags{ORM}},
{"testify", "github.com/stretchr/testify", Tags{TEST_FRAMEWORK}},
{"testza", "github.com/MarvinJWendt/testza", Tags{TEST_FRAMEWORK}},
{"beego", "github.com/beego/beego/v2", Tags{WEB_FRAMEWORK}},
{"fasthttp", "github.com/valyala/fasthttp", Tags{WEB_FRAMEWORK}},
{"fiber", "github.com/gofiber/fiber/v2", Tags{WEB_FRAMEWORK}},
{"gin", "github.com/gin-gonic/gin", Tags{WEB_FRAMEWORK}},
{"lo", "github.com/samber/lo", Tags{UTILS}},
{"colly", "github.com/gocolly/colly/v2", Tags{WEB_SCRAPER}},
{"excelize", "github.com/qax-os/excelize/v2", Tags{DOCUMENT_PARSER}},
{"gjson", "github.com/tidwall/gjson", Tags{PARSER}},
{"urfave/cli", "github.com/urfave/cli/v2", Tags{CLI}},
{"gorilla/mux", "github.com/gorilla/mux", Tags{WEB_FRAMEWORK}},
{"gorilla/websocket", "github.com/gorilla/websocket", Tags{WEBSOCKET}},
{"ebiten", "github.com/hajimehoshi/ebiten/v2", Tags{GAME_ENGINE}},
}
type Tag string
type Tags []Tag
const (
WEB_FRAMEWORK Tag = "Web Framework"
WEB_SCRAPER Tag = "Web Scraper"
CLI Tag = "CLI"
TEST_FRAMEWORK Tag = "Test Framework"
ORM Tag = "ORM"
LOGGING Tag = "Logging"
GUI Tag = "GUI"
UTILS Tag = "Utils"
DOCUMENT_PARSER Tag = "Document Parser"
PARSER Tag = "Parser"
WEBSOCKET Tag = "Websocket"
GAME_ENGINE Tag = "Game Engine"
)
func (t Tags) String() string {
var tags []string
for _, tag := range t {
tags = append(tags, string(tag))
}
return strings.Join(tags, ", ")
}