mirror of
https://github.com/postmannen/ctrl.git
synced 2024-12-14 12:37:31 +00:00
renamed CLICommandReply to REQTextToConsole
This commit is contained in:
parent
debd146f28
commit
af06e47b7b
4 changed files with 34 additions and 34 deletions
|
@ -112,8 +112,8 @@ type Configuration struct {
|
|||
StartSubREQCliCommand flagNodeSlice
|
||||
// Subscriber for REQnCliCommand
|
||||
StartSubREQnCliCommand flagNodeSlice
|
||||
// Subscriber for CLICommandReply
|
||||
StartSubCLICommandReply flagNodeSlice
|
||||
// Subscriber for REQTextToConsole
|
||||
StartSubREQTextToConsole flagNodeSlice
|
||||
}
|
||||
|
||||
func NewConfiguration() *Configuration {
|
||||
|
@ -124,23 +124,23 @@ func NewConfiguration() *Configuration {
|
|||
// Default configuration
|
||||
func newConfigurationDefaults() Configuration {
|
||||
c := Configuration{
|
||||
ConfigFolder: "./etc",
|
||||
BrokerAddress: "127.0.0.1:4222",
|
||||
ProfilingPort: "",
|
||||
PromHostAndPort: "",
|
||||
DefaultMessageTimeout: 10,
|
||||
DefaultMessageRetries: 1,
|
||||
StartPubSayHello: 30,
|
||||
SubscribersDataFolder: "./data",
|
||||
CentralNodeName: "",
|
||||
StartSubErrorLog: flagNodeSlice{Values: []node{}},
|
||||
StartSubSayHello: flagNodeSlice{OK: true, Values: []node{"*"}},
|
||||
StartSubTextLogging: flagNodeSlice{OK: true, Values: []node{"*"}},
|
||||
StartSubEchoRequest: flagNodeSlice{OK: true, Values: []node{"*"}},
|
||||
StartSubEchoReply: flagNodeSlice{OK: true, Values: []node{"*"}},
|
||||
StartSubREQCliCommand: flagNodeSlice{OK: true, Values: []node{"*"}},
|
||||
StartSubREQnCliCommand: flagNodeSlice{OK: true, Values: []node{"*"}},
|
||||
StartSubCLICommandReply: flagNodeSlice{OK: true, Values: []node{"*"}},
|
||||
ConfigFolder: "./etc",
|
||||
BrokerAddress: "127.0.0.1:4222",
|
||||
ProfilingPort: "",
|
||||
PromHostAndPort: "",
|
||||
DefaultMessageTimeout: 10,
|
||||
DefaultMessageRetries: 1,
|
||||
StartPubSayHello: 30,
|
||||
SubscribersDataFolder: "./data",
|
||||
CentralNodeName: "",
|
||||
StartSubErrorLog: flagNodeSlice{Values: []node{}},
|
||||
StartSubSayHello: flagNodeSlice{OK: true, Values: []node{"*"}},
|
||||
StartSubTextLogging: flagNodeSlice{OK: true, Values: []node{"*"}},
|
||||
StartSubEchoRequest: flagNodeSlice{OK: true, Values: []node{"*"}},
|
||||
StartSubEchoReply: flagNodeSlice{OK: true, Values: []node{"*"}},
|
||||
StartSubREQCliCommand: flagNodeSlice{OK: true, Values: []node{"*"}},
|
||||
StartSubREQnCliCommand: flagNodeSlice{OK: true, Values: []node{"*"}},
|
||||
StartSubREQTextToConsole: flagNodeSlice{OK: true, Values: []node{"*"}},
|
||||
}
|
||||
return c
|
||||
}
|
||||
|
@ -179,7 +179,7 @@ func (c *Configuration) CheckFlags() error {
|
|||
flag.Var(&c.StartSubEchoReply, "startSubEchoReply", "Specify comma separated list for nodes to allow messages from. Use \"*\" for from all. Value RST will turn off subscriber.")
|
||||
flag.Var(&c.StartSubREQCliCommand, "startSubREQCliCommand", "Specify comma separated list for nodes to allow messages from. Use \"*\" for from all. Value RST will turn off subscriber.")
|
||||
flag.Var(&c.StartSubREQnCliCommand, "startSubREQnCliCommand", "Specify comma separated list for nodes to allow messages from. Use \"*\" for from all. Value RST will turn off subscriber.")
|
||||
flag.Var(&c.StartSubCLICommandReply, "startSubCLICommandReply", "Specify comma separated list for nodes to allow messages from. Use \"*\" for from all. Value RST will turn off subscriber.")
|
||||
flag.Var(&c.StartSubREQTextToConsole, "startSubREQTextToConsole", "Specify comma separated list for nodes to allow messages from. Use \"*\" for from all. Value RST will turn off subscriber.")
|
||||
|
||||
flag.Parse()
|
||||
|
||||
|
|
|
@ -9,10 +9,6 @@ PromHostAndPort = ":2112"
|
|||
StartPubSayHello = 0
|
||||
SubscribersDataFolder = "./data"
|
||||
|
||||
[StartSubCLICommandReply]
|
||||
OK = true
|
||||
Values = ["*"]
|
||||
|
||||
[StartSubEchoReply]
|
||||
OK = true
|
||||
Values = ["*"]
|
||||
|
@ -29,6 +25,10 @@ SubscribersDataFolder = "./data"
|
|||
OK = true
|
||||
Values = ["*"]
|
||||
|
||||
[StartSubREQTextToConsole]
|
||||
OK = true
|
||||
Values = ["*"]
|
||||
|
||||
[StartSubREQnCliCommand]
|
||||
OK = true
|
||||
Values = ["*"]
|
||||
|
|
|
@ -116,11 +116,11 @@ func (s *server) ProcessesStart() {
|
|||
}
|
||||
|
||||
// Start a subscriber for CLICommandReply messages
|
||||
if s.configuration.StartSubCLICommandReply.OK {
|
||||
if s.configuration.StartSubREQTextToConsole.OK {
|
||||
{
|
||||
fmt.Printf("Starting CLICommand Reply subscriber: %#v\n", s.nodeName)
|
||||
sub := newSubject(CLICommandReply, s.nodeName)
|
||||
proc := newProcess(s.processes, s.toRingbufferCh, s.configuration, sub, s.errorKernel.errorCh, processKindSubscriber, s.configuration.StartSubCLICommandReply.Values, nil)
|
||||
fmt.Printf("Starting Text To Console subscriber: %#v\n", s.nodeName)
|
||||
sub := newSubject(REQTextToConsole, s.nodeName)
|
||||
proc := newProcess(s.processes, s.toRingbufferCh, s.configuration, sub, s.errorKernel.errorCh, processKindSubscriber, s.configuration.StartSubREQTextToConsole.Values, nil)
|
||||
go proc.spawnWorker(s)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -80,7 +80,7 @@ const (
|
|||
// start up for receiving the CLICommand request messages.
|
||||
// The data field is a slice of strings where the first string
|
||||
// value should be the command, and the following the arguments.
|
||||
CLICommandReply Method = "CLICommandReply"
|
||||
REQTextToConsole Method = "REQTextToConsole"
|
||||
// Send text logging to some host.
|
||||
// A file with the full subject+hostName will be created on
|
||||
// the receiving end.
|
||||
|
@ -122,7 +122,7 @@ func (m Method) GetMethodsAvailable() MethodsAvailable {
|
|||
REQnCliCommand: methodREQnCliCommand{
|
||||
commandOrEvent: CommandACK,
|
||||
},
|
||||
CLICommandReply: methodCLICommandReply{
|
||||
REQTextToConsole: methodREQTextToConsole{
|
||||
commandOrEvent: EventACK,
|
||||
},
|
||||
TextLogging: methodTextLogging{
|
||||
|
@ -495,7 +495,7 @@ func (m methodREQnCliCommand) handler(proc process, message Message, node string
|
|||
|
||||
// Prepare and queue for sending a new message with the output
|
||||
// of the action executed.
|
||||
newReplyMessage(proc, message, CLICommandReply, out)
|
||||
newReplyMessage(proc, message, REQTextToConsole, out)
|
||||
}
|
||||
|
||||
}()
|
||||
|
@ -506,15 +506,15 @@ func (m methodREQnCliCommand) handler(proc process, message Message, node string
|
|||
|
||||
// ---
|
||||
|
||||
type methodCLICommandReply struct {
|
||||
type methodREQTextToConsole struct {
|
||||
commandOrEvent CommandOrEvent
|
||||
}
|
||||
|
||||
func (m methodCLICommandReply) getKind() CommandOrEvent {
|
||||
func (m methodREQTextToConsole) getKind() CommandOrEvent {
|
||||
return m.commandOrEvent
|
||||
}
|
||||
|
||||
func (m methodCLICommandReply) handler(proc process, message Message, node string) ([]byte, error) {
|
||||
func (m methodREQTextToConsole) handler(proc process, message Message, node string) ([]byte, error) {
|
||||
fmt.Printf("<--- methodCLICommandReply: %v\n", message.Data)
|
||||
|
||||
ackMsg := []byte("confirmed from: " + node + ": " + fmt.Sprint(message.ID))
|
||||
|
|
Loading…
Reference in a new issue