Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( RootCmd = &cobra.Command{ Use: "internal-api", Short: "Run the BarnBridge internal api", PersistentPreRun: func(cmd *cobra.Command, args []string) { err := viper.BindPFlags(cmd.Flags()) if err != nil { log.Fatal(err) } if configPath != "" { abs, err := filepath.Abs(configPath) if err != nil { log.Error("Error reading filepath: ", err.Error()) } base := filepath.Base(abs) path := filepath.Dir(abs) viper.SetConfigName(strings.Split(base, ".")[0]) viper.AddConfigPath(path) } viper.AddConfigPath(".") if err := viper.ReadInConfig(); err != nil { log.Info("Could not load config file. Falling back to args. Error: ", err) } buildDBConnectionString() initLogging() config.Load() }, Run: func(cmd *cobra.Command, args []string) { cmd.HelpFunc()(cmd, args) }, } )
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.