aboutsummaryrefslogtreecommitdiffstats
path: root/golang/cmd/fatcatd/root.go
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-05-26 16:42:17 -0700
committerBryan Newbold <bnewbold@robocracy.org>2018-05-26 16:42:19 -0700
commit82f8b4d838de3fb8eda5db9b23c5bc48ab281f9e (patch)
tree2b684049829c72fbdd4289535b18a19b884f377b /golang/cmd/fatcatd/root.go
parent9b3e52e813bbd9dc9b1771ca2c63e33d93048e97 (diff)
downloadfatcat-82f8b4d838de3fb8eda5db9b23c5bc48ab281f9e.tar.gz
fatcat-82f8b4d838de3fb8eda5db9b23c5bc48ab281f9e.zip
remove golang API server
Not following that path; this is to prevent future confusion. All code is still in version control.
Diffstat (limited to 'golang/cmd/fatcatd/root.go')
-rw-r--r--golang/cmd/fatcatd/root.go72
1 files changed, 0 insertions, 72 deletions
diff --git a/golang/cmd/fatcatd/root.go b/golang/cmd/fatcatd/root.go
deleted file mode 100644
index 12be35b3..00000000
--- a/golang/cmd/fatcatd/root.go
+++ /dev/null
@@ -1,72 +0,0 @@
-
-package main
-
-import (
- "os"
- "fmt"
-
- log "github.com/sirupsen/logrus"
- "github.com/spf13/viper"
- "github.com/spf13/cobra"
- "github.com/getsentry/raven-go"
-)
-
-var cfgFile = "";
-
-var rootCmd = &cobra.Command{
- Use: "fatcatd",
- Short: "REST API Server",
- Long: "A scalable, versioned, API-oriented catalog of bibliographic entities and file metadata",
- Version: "0.1.0",
-}
-
-func init() {
- cobra.OnInitialize(initConfig)
- rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is ./fatcatd.toml)")
- rootCmd.PersistentFlags().BoolP("verbose", "v", false, "increase logging volume")
- viper.BindPFlag("verbose", rootCmd.PersistentFlags().Lookup("verbose"))
-
- serveCmd.Flags().String("db-url", "postgres://", "database connecion string")
-
- rootCmd.AddCommand(serveCmd)
- rootCmd.AddCommand(reinitCmd)
-}
-
-func initConfig() {
-
- viper.SetDefault("port", 9411)
- viper.SetEnvPrefix("FATCAT")
- viper.AutomaticEnv()
-
- if cfgFile != "" {
- // Use config file from the flag.
- viper.SetConfigFile(cfgFile)
- } else {
- viper.SetConfigType("toml")
- viper.AddConfigPath(".")
- viper.SetConfigName("fatcatd")
- }
-
- err := viper.ReadInConfig()
- if err != nil {
- log.Fatalf("Error loading config: %s \n", err)
- }
-
- // not default of stderr
- log.SetOutput(os.Stdout);
-
- if viper.GetBool("verbose") == true {
- log.SetLevel(log.DebugLevel)
- }
- log.Debug("It's verbose!")
-
- raven.SetDSN(viper.GetString("sentry_dsn"));
-
-}
-
-func Execute() {
- if err := rootCmd.Execute(); err != nil {
- fmt.Println(err)
- os.Exit(1)
- }
-}