github.com/hellofresh/janus@v0.0.0-20230925145208-ce8de8183c67/cmd/root.go (about) 1 package cmd 2 3 import ( 4 "context" 5 6 "github.com/spf13/cobra" 7 ) 8 9 var configFile string 10 11 // NewRootCmd creates a new instance of the root command 12 func NewRootCmd(version string) *cobra.Command { 13 ctx := context.Background() 14 15 cmd := &cobra.Command{ 16 Use: "janus", 17 Version: version, 18 Short: "Janus is an API Gateway", 19 Long: ` 20 This is a lightweight API Gateway and Management Platform that enables you 21 to control who accesses your API, when they access it and how they access it. 22 API Gateway will also record detailed analytics on how your users are interacting 23 with your API and when things go wrong. 24 Complete documentation is available at https://hellofresh.gitbooks.io/janus`, 25 } 26 27 cmd.PersistentFlags().StringVarP(&configFile, "config", "c", "", "Config file (default is $PWD/janus.toml)") 28 29 cmd.AddCommand(NewCheckCmd(ctx)) 30 cmd.AddCommand(NewServerStartCmd(ctx, version)) 31 32 return cmd 33 }