Refactor signer code into command and package

This commit is contained in:
Jan Dittberner 2021-01-04 14:15:12 +01:00
parent 3a2578ae55
commit 38566f35ef
13 changed files with 476 additions and 276 deletions

View file

@ -2,7 +2,6 @@ package main
import (
"flag"
"io"
"os"
"os/signal"
"sync"
@ -45,13 +44,12 @@ func main() {
requestChannel := protocol.NewSignerProtocolRequestChannel()
responseChannel := make(chan *datastructures.SignerResponse, 1)
readWriteCloser := (io.ReadWriteCloser)(port)
clientProtocolConfig := protocol.NewSignerProtocolConfig()
if clientConfig.BufferSize != 0 {
clientProtocolConfig.BufferSize = int(clientConfig.BufferSize)
}
protocolHandler := protocol.NewProtocolHandler(
requestChannel, &responseChannel, &readWriteCloser, clientProtocolConfig,
requestChannel, &responseChannel, port, clientProtocolConfig,
)
cancelChannel := make(chan os.Signal, 1)