release: new project template

This commit is contained in:
2023-01-01 23:46:41 +08:00
committed by xuthus5
parent 08d0662fe6
commit 1143e0624c
22 changed files with 858 additions and 42 deletions

39
coco/main.go Normal file
View File

@@ -0,0 +1,39 @@
package main
import (
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"gitter.top/coco/bootstrap"
)
var (
rootCmd = &cobra.Command{
Use: "coco",
Short: "golang project toolkit",
}
)
func init() {
logrus.SetFormatter(&logrus.TextFormatter{
ForceColors: true,
EnvironmentOverrideColors: true,
DisableTimestamp: true,
DisableSorting: true,
DisableLevelTruncation: false,
PadLevelText: false,
QuoteEmptyFields: false,
})
rootCmd.AddCommand(bootstrap.Update())
rootCmd.AddCommand(bootstrap.CreateProject())
rootCmd.AddCommand(bootstrap.AddAPICommand())
rootCmd.AddCommand(bootstrap.AddServiceCommand())
rootCmd.AddCommand(bootstrap.GenerateProtoFile())
rootCmd.AddCommand(bootstrap.InjectProtoFile())
}
func main() {
if err := rootCmd.Execute(); err != nil {
logrus.Fatalln(err)
}
}