Rename store Namespace / Prefix options to Database and Table (#1492)
* Rename Namespace to DB, Rename Prefix to table, Remove Suffix Option * Rename options * Rename options * Add store_table option * Table per service, not Database per service
This commit is contained in:
		| @@ -225,9 +225,14 @@ var ( | ||||
| 			Usage:   "Comma-separated list of store addresses", | ||||
| 		}, | ||||
| 		&cli.StringFlag{ | ||||
| 			Name:    "store_namespace", | ||||
| 			EnvVars: []string{"MICRO_STORE_NAMESPACE"}, | ||||
| 			Usage:   "Namespace for store data", | ||||
| 			Name:    "store_database", | ||||
| 			EnvVars: []string{"MICRO_STORE_DATABASE"}, | ||||
| 			Usage:   "Database option for the underlying store", | ||||
| 		}, | ||||
| 		&cli.StringFlag{ | ||||
| 			Name:    "store_table", | ||||
| 			EnvVars: []string{"MICRO_STORE_Table"}, | ||||
| 			Usage:   "Table option for the underlying store", | ||||
| 		}, | ||||
| 		&cli.StringFlag{ | ||||
| 			Name:    "transport", | ||||
| @@ -622,9 +627,15 @@ func (c *cmd) Before(ctx *cli.Context) error { | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	if len(ctx.String("store_namespace")) > 0 { | ||||
| 		if err := (*c.opts.Store).Init(store.Namespace(ctx.String("store_namespace"))); err != nil { | ||||
| 			logger.Fatalf("Error configuring store: %v", err) | ||||
| 	if len(ctx.String("store_database")) > 0 { | ||||
| 		if err := (*c.opts.Store).Init(store.Database(ctx.String("store_database"))); err != nil { | ||||
| 			logger.Fatalf("Error configuring store database option: %v", err) | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	if len(ctx.String("store_table")) > 0 { | ||||
| 		if err := (*c.opts.Store).Init(store.Table(ctx.String("store_table"))); err != nil { | ||||
| 			logger.Fatalf("Error configuring store table option: %v", err) | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user