Browse Source

rename process_line to process_stack to better reflect name

flashmob 8 years ago
parent
commit
0c160b635d
3 changed files with 7 additions and 8 deletions
  1. 1 1
      backends/backend.go
  2. 4 4
      backends/gateway.go
  3. 2 3
      cmd/guerrillad/serve.go

+ 1 - 1
backends/backend.go

@@ -181,7 +181,7 @@ func (b *BackendService) Shutdown() {
 	b.Shutdowners = make([]ProcessorShutdowner, 0)
 }
 
-// AddProcessor adds a new processor, which becomes available to the backend_config.process_line option
+// AddProcessor adds a new processor, which becomes available to the backend_config.process_stack option
 func (b *BackendService) AddProcessor(name string, p ProcessorConstructor) {
 	// wrap in a constructor since we want to defer calling it
 	var c ProcessorConstructor

+ 4 - 4
backends/gateway.go

@@ -32,7 +32,7 @@ type BackendGateway struct {
 
 type GatewayConfig struct {
 	WorkersSize   int    `json:"save_workers_size,omitempty"`
-	ProcessorLine string `json:"process_line,omitempty"`
+	ProcessorLine string `json:"process_stack,omitempty"`
 }
 
 // savePayload is what get placed on the BackendGateway.saveMailChan channel
@@ -127,7 +127,7 @@ func (gw *BackendGateway) Reinitialize() error {
 // newProcessorLine creates a new call-stack of decorators and returns as a single Processor
 // Decorators are functions of Decorator type, source files prefixed with p_*
 // Each decorator does a specific task during the processing stage.
-// This function uses the config value process_line to figure out which Decorator to use
+// This function uses the config value process_stack to figure out which Decorator to use
 func (gw *BackendGateway) newProcessorLine() Processor {
 	var decorators []Decorator
 	if len(gw.gwConfig.ProcessorLine) == 0 {
@@ -148,8 +148,8 @@ func (gw *BackendGateway) newProcessorLine() Processor {
 // loadConfig loads the config for the GatewayConfig
 func (gw *BackendGateway) loadConfig(cfg BackendConfig) error {
 	configType := BaseConfig(&GatewayConfig{})
-	if _, ok := cfg["process_line"]; !ok {
-		cfg["process_line"] = "Debugger"
+	if _, ok := cfg["process_stack"]; !ok {
+		cfg["process_stack"] = "Debugger"
 	}
 	if _, ok := cfg["save_workers_size"]; !ok {
 		cfg["save_workers_size"] = 1

+ 2 - 3
cmd/guerrillad/serve.go

@@ -171,9 +171,8 @@ func serve(cmd *cobra.Command, args []string) {
 // the the command line interface.
 type CmdConfig struct {
 	guerrilla.AppConfig
-	BackendName        string                 `json:"backend_name"`
-	BackendConfig      backends.BackendConfig `json:"backend_config"`
-	BackendProcessLine string                 `json:"backend_process_line"`
+	BackendName   string                 `json:"backend_name"`
+	BackendConfig backends.BackendConfig `json:"backend_config"`
 }
 
 func (c *CmdConfig) load(jsonBytes []byte) error {