Documentation ¶
Index ¶
Constants ¶
View Source
const Version = "0.0.1"
Variables ¶
View Source
var StartCmd = &cobra.Command{ Use: "start", Short: "start the uup service", Run: func(cmd *cobra.Command, args []string) { logger, finalizer := service.InitializeLogger() defer finalizer() opts, useTLS, clientTimeout := buildOptsFromCLIParams() s, err := service.New(opts...) if err != nil { log.Fatalln(err) } s.ListenAndServe(context.Background()) srv := &http.Server{ Handler: s.Routes(), Addr: httpAddr, WriteTimeout: clientTimeout, ReadTimeout: clientTimeout, } if useTLS { if httpsRedirectorAddr != "" { ctx, cancel := context.WithCancel(context.Background()) defer cancel() err := service.StartHTTPToHTTPSRedirector(ctx, httpsRedirectorAddr, httpAddr, time.Second) if err != nil { os.Exit(1) } } logger.Info("https server listening", zap.String("addr", httpAddr)) log.Fatal(srv.ListenAndServeTLS(tlsCertFilePath, tlsKeyFilePath)) } else { logger.Info("http server listening", zap.String("addr", httpAddr)) log.Fatal(srv.ListenAndServe()) } }, }
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.