fup: add bucket-url flag for specifying storage

This allows setting the persistent storage location to save files into.

NOTE: defaults to mem:// for development purposes, which... is gonna be a bad
time.
This commit is contained in:
Luke Granger-Brown 2021-03-20 23:33:39 +00:00
parent 7e4fb52cef
commit 25443cfaab

View file

@ -13,6 +13,7 @@ import (
var (
cfgFile string
bucketURL string
rootCmd = &cobra.Command{
Use: "fup",
@ -29,6 +30,8 @@ func init() {
cobra.OnInitialize(initConfig)
rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file")
rootCmd.PersistentFlags().StringVar(&bucketURL, "bucket-url", "mem://", "gocloud.dev-compatible URL to use for file storage")
viper.BindPFlag("storage.bucketURL", rootCmd.PersistentFlags().Lookup("bucket-url"))
}
func initConfig() {