Refactor client I/O into protocol package
This commit is contained in:
parent
337e974a26
commit
9924771531
7 changed files with 339 additions and 200 deletions
20
client/processing/process.go
Normal file
20
client/processing/process.go
Normal file
|
@ -0,0 +1,20 @@
|
|||
package processing
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"git.cacert.org/cacert-gosigner/datastructures"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
func Process(response *datastructures.SignerResponse) (err error) {
|
||||
logrus.Infof("process response of type %s", response.Action)
|
||||
logrus.Tracef("process response %v", response)
|
||||
|
||||
switch response.Action {
|
||||
case datastructures.ActionNul:
|
||||
logrus.Trace("received response for NUL request")
|
||||
return
|
||||
default:
|
||||
return fmt.Errorf("unsupported action in response 0x%x", response.Action)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue