From 4a413baf9f1aed26c20ceb5b83d37174cf860c14 Mon Sep 17 00:00:00 2001 From: postmannen Date: Sun, 10 Mar 2024 21:36:37 +0100 Subject: [PATCH] Removed some remaings after REQToFileNACK --- README.md | 14 +------------- configuration_flags.go | 4 ---- processes.go | 4 ---- requests.go | 3 --- 4 files changed, 1 insertion(+), 24 deletions(-) diff --git a/README.md b/README.md index 5ac2535..bf1ee4f 100644 --- a/README.md +++ b/README.md @@ -327,19 +327,7 @@ The flow will be like this: ### Flags and configuration file -ctrl supports both the use of flags with values set at startup, and the use of a config file. - -- A default config file will be created at first startup if one does not exist - - The default config will contain default values. - - Any value also provided via a flag will also be written to the config file. -- If **ctrl** is restarted, the current content of the config file will be used as the new defaults. - - If you restart ctrl without any flags specified, the values of the last run will be read from the config file. -- If new values are provided via CLI flags, they will take **precedence** over the ones currently in the config file. - - The new CLI flag values will be written to the config, making it the default for the next restart. -- The config file can be edited directly, removing the need for CLI flag use. -- To create a default config, simply: - 1. Remove the current config file (or move it). - 2. Restart ctrl. A new default config file, with default values, will be created. +ctrl supports both the use of flags with env variables. An .env file can also be used. ### Schema for the messages to send into ctrl via the API's diff --git a/configuration_flags.go b/configuration_flags.go index c50b929..8a29353 100644 --- a/configuration_flags.go +++ b/configuration_flags.go @@ -118,8 +118,6 @@ type Configuration struct { StartSubREQToFileAppend bool `comment:"Start subscriber for text logging"` // Start subscriber for writing to file StartSubREQToFile bool `comment:"Start subscriber for writing to file"` - // Start subscriber for writing to file without ACK - StartSubREQToFileNACK bool `comment:"Start subscriber for writing to file without ACK"` // Start subscriber for reading files to copy StartSubREQCopySrc bool `comment:"Start subscriber for reading files to copy"` // Start subscriber for writing copied files to disk @@ -199,7 +197,6 @@ func NewConfiguration() *Configuration { flag.BoolVar(&c.StartSubREQHello, "startSubREQHello", CheckEnv("START_SUB_REQ_HELLO", c.StartSubREQHello).(bool), "true/false") flag.BoolVar(&c.StartSubREQToFileAppend, "startSubREQToFileAppend", CheckEnv("START_SUB_REQ_TO_FILE_APPEND", c.StartSubREQToFileAppend).(bool), "true/false") flag.BoolVar(&c.StartSubREQToFile, "startSubREQToFile", CheckEnv("START_SUB_REQ_TO_FILE", c.StartSubREQToFile).(bool), "true/false") - flag.BoolVar(&c.StartSubREQToFileNACK, "startSubREQToFileNACK", CheckEnv("START_SUB_REQ_TO_FILE_NACK", c.StartSubREQToFileNACK).(bool), "true/false") flag.BoolVar(&c.StartSubREQCopySrc, "startSubREQCopySrc", CheckEnv("START_SUB_REQ_COPY_SRC", c.StartSubREQCopySrc).(bool), "true/false") flag.BoolVar(&c.StartSubREQCopyDst, "startSubREQCopyDst", CheckEnv("START_SUB_REQ_COPY_DST", c.StartSubREQCopyDst).(bool), "true/false") flag.BoolVar(&c.StartSubREQCliCommand, "startSubREQCliCommand", CheckEnv("START_SUB_REQ_CLI_COMMAND", c.StartSubREQCliCommand).(bool), "true/false") @@ -273,7 +270,6 @@ func newConfigurationDefaults() Configuration { StartSubREQHello: true, StartSubREQToFileAppend: true, StartSubREQToFile: true, - StartSubREQToFileNACK: true, StartSubREQCopySrc: true, StartSubREQCopyDst: true, StartSubREQCliCommand: true, diff --git a/processes.go b/processes.go index 91cfeff..0458128 100644 --- a/processes.go +++ b/processes.go @@ -105,10 +105,6 @@ func (p *processes) Start(proc process) { proc.startup.subscriber(proc, REQToFile, nil) } - if proc.configuration.StartSubREQToFileNACK { - proc.startup.subscriber(proc, REQToFileNACK, nil) - } - if proc.configuration.StartSubREQCopySrc { proc.startup.subscriber(proc, REQCopySrc, nil) } diff --git a/requests.go b/requests.go index 6900aaf..942c495 100644 --- a/requests.go +++ b/requests.go @@ -95,8 +95,6 @@ const ( // The data field is a slice of strings where the values of the // slice will be written to the file. REQToFile Method = "REQToFile" - // REQToFileNACK same as REQToFile but NACK. - REQToFileNACK Method = "REQToFileNACK" // Initiated by the user. REQCopySrc Method = "REQCopySrc" // Initial request for file copying. @@ -184,7 +182,6 @@ func (m Method) GetMethodsAvailable() MethodsAvailable { REQToConsole: HandlerFunc(methodREQToConsole), REQToFileAppend: HandlerFunc(methodREQToFileAppend), REQToFile: HandlerFunc(methodREQToFile), - REQToFileNACK: HandlerFunc(methodREQToFile), REQCopySrc: HandlerFunc(methodREQCopySrc), REQCopyDst: HandlerFunc(methodREQCopyDst), REQSUBCopySrc: HandlerFunc(methodREQSUB),