mirror of
https://github.com/postmannen/ctrl.git
synced 2025-03-31 01:24:31 +00:00
added so you can define requests without a method, and just have a procFunc.
This commit is contained in:
parent
8ac14720cc
commit
894bdf2554
3 changed files with 16 additions and 12 deletions
|
@ -535,7 +535,7 @@ func executeHandler(p process, message Message, thisNode string) {
|
|||
}
|
||||
|
||||
switch {
|
||||
case !runAsScheduled:
|
||||
case !runAsScheduled && p.handler != nil:
|
||||
|
||||
go func() {
|
||||
_, err = p.handler(p, message, thisNode)
|
||||
|
|
|
@ -132,7 +132,7 @@ func (p *processes) Start(proc process) {
|
|||
}
|
||||
|
||||
if proc.configuration.StartProcesses.EnableKeyUpdates {
|
||||
proc.startup.startProcess(proc, KeysRequestUpdate, procFuncKeysRequestUpdate)
|
||||
proc.startup.startProcess(proc, KeysRequestUpdatePublisher, procFuncKeysRequestUpdate)
|
||||
proc.startup.startProcess(proc, KeysDeliverUpdate, nil)
|
||||
}
|
||||
|
||||
|
|
24
requests.go
24
requests.go
|
@ -129,6 +129,8 @@ const (
|
|||
KeysRequestUpdate Method = "keysRequestUpdate"
|
||||
// REQKeysRequestUpdatePublisher send the current hash of the locally stored public keys to
|
||||
// the central key server, and get an update from central if needed.
|
||||
KeysRequestUpdatePublisher Method = "keysRequestUpdatePublisher"
|
||||
// REQKeysDeliverUpdate will deliver the public from central to a node.
|
||||
KeysDeliverUpdate Method = "keysDeliverUpdate"
|
||||
// REQKeysAllow
|
||||
KeysAllow Method = "keysAllow"
|
||||
|
@ -193,16 +195,18 @@ func (m Method) GetMethodsAvailable() MethodsAvailable {
|
|||
// The hello publisher will not subscribe for messages, it will
|
||||
// only start a procFunc, so we we don't need a handler with a method,
|
||||
// so we set it to nil.
|
||||
HelloPublisher: HandlerFunc(nil),
|
||||
ErrorLog: HandlerFunc(methodErrorLog),
|
||||
HttpGet: HandlerFunc(methodHttpGet),
|
||||
HttpGetScheduled: HandlerFunc(methodHttpGetScheduled),
|
||||
TailFile: HandlerFunc(methodTailFile),
|
||||
PublicKey: HandlerFunc(methodPublicKey),
|
||||
KeysRequestUpdate: HandlerFunc(methodKeysRequestUpdate),
|
||||
KeysDeliverUpdate: HandlerFunc(methodKeysReceiveUpdate),
|
||||
KeysAllow: HandlerFunc(methodKeysAllow),
|
||||
KeysDelete: HandlerFunc(methodKeysDelete),
|
||||
HelloPublisher: HandlerFunc(nil),
|
||||
ErrorLog: HandlerFunc(methodErrorLog),
|
||||
HttpGet: HandlerFunc(methodHttpGet),
|
||||
HttpGetScheduled: HandlerFunc(methodHttpGetScheduled),
|
||||
TailFile: HandlerFunc(methodTailFile),
|
||||
PublicKey: HandlerFunc(methodPublicKey),
|
||||
|
||||
KeysRequestUpdatePublisher: HandlerFunc(methodKeysRequestUpdate),
|
||||
KeysRequestUpdate: HandlerFunc(nil),
|
||||
KeysDeliverUpdate: HandlerFunc(methodKeysReceiveUpdate),
|
||||
KeysAllow: HandlerFunc(methodKeysAllow),
|
||||
KeysDelete: HandlerFunc(methodKeysDelete),
|
||||
|
||||
AclRequestUpdate: HandlerFunc(methodAclRequestUpdate),
|
||||
AclDeliverUpdate: HandlerFunc(methodAclDeliverUpdate),
|
||||
|
|
Loading…
Add table
Reference in a new issue