accountserver/cmd/serve.go

40 lines
1.3 KiB
Go

package cmd
import (
"code.icod.de/auth/accountserver/configuration"
"github.com/spf13/cobra"
)
// serveCmd represents the serve command
var serveCmd = &cobra.Command{
Use: "serve",
Short: "Run the account server",
RunE: func(cmd *cobra.Command, args []string) error {
return nil
},
}
func init() {
rootCmd.AddCommand(serveCmd)
// Here you will define your flags and configuration settings.
serveCmd.Flags().BoolVar(&configuration.Debug, "debug", false, "enable debug mode")
serveCmd.Flags().BoolVar(&configuration.RunHTTP, "http", true, "Run http server")
serveCmd.Flags().BoolVar(&configuration.RunGRPC, "grpc", true, "Run grpc server")
serveCmd.Flags().StringVar(&configuration.SMTPHost, "smtp-host", "localhost", "SMTP host")
serveCmd.Flags().IntVar(&configuration.SMTPPort, "smtp-port", 587, "SMTP port")
serveCmd.Flags().StringVar(&configuration.SMTPUser, "smtp-user", "", "SMTP user")
serveCmd.Flags().StringVar(&configuration.SMTPPass, "smtp-pass", "", "SMTP password")
// Cobra supports Persistent Flags which will work for this command
// and all subcommands, e.g.:
// serveCmd.PersistentFlags().String("foo", "", "A help for foo")
// Cobra supports local flags which will only run when this command
// is called directly, e.g.:
// serveCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
}