Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var RootCmd = &cobra.Command{ Use: "bitfan-ui", Short: "Bitfan Web UI", Long: ``, PreRun: func(cmd *cobra.Command, args []string) { viper.BindPFlag("dev", cmd.Flags().Lookup("dev")) viper.BindPFlag("host", cmd.Flags().Lookup("host")) viper.BindPFlag("api", cmd.Flags().Lookup("api")) }, Run: func(cmd *cobra.Command, args []string) { httpServerMux := http.NewServeMux() httpServerMux.Handle("/", server.Handler( viper.GetString("api"), viper.GetBool("dev"), )) addr := viper.GetString("host") fmt.Printf("serving on http://%s\n", addr) http.ListenAndServe(addr, httpServerMux) }, }
RootCmd represents the base command when called without any subcommands
View Source
var Version = "No Version Provided"
Functions ¶
func Execute ¶
func Execute()
Execute adds all child commands to the root command sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.
func GetService ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.