chore: Strip unneeded components from code.
This commit is contained in:
parent
62cc8b39ad
commit
cf90ddb104
19 changed files with 228 additions and 762 deletions
|
@ -112,11 +112,10 @@ func entrypoint(cCtx *cli.Context) error {
|
|||
defer sock.Close()
|
||||
|
||||
startCommand := &commonbackend.Start{
|
||||
Type: "start",
|
||||
Arguments: backendParameters,
|
||||
}
|
||||
|
||||
startMarshalledCommand, err := commonbackend.Marshal("start", startCommand)
|
||||
startMarshalledCommand, err := commonbackend.Marshal(startCommand)
|
||||
|
||||
if err != nil {
|
||||
log.Errorf("failed to generate start command: %s", err.Error())
|
||||
|
@ -128,18 +127,13 @@ func entrypoint(cCtx *cli.Context) error {
|
|||
continue
|
||||
}
|
||||
|
||||
commandType, commandRaw, err := commonbackend.Unmarshal(sock)
|
||||
commandRaw, err := commonbackend.Unmarshal(sock)
|
||||
|
||||
if err != nil {
|
||||
log.Errorf("failed to read from/unmarshal from socket: %s", err.Error())
|
||||
continue
|
||||
}
|
||||
|
||||
if commandType != "backendStatusResponse" {
|
||||
log.Errorf("recieved commandType '%s', expecting 'backendStatusResponse'", commandType)
|
||||
continue
|
||||
}
|
||||
|
||||
command, ok := commandRaw.(*commonbackend.BackendStatusResponse)
|
||||
|
||||
if !ok {
|
||||
|
@ -168,14 +162,13 @@ func entrypoint(cCtx *cli.Context) error {
|
|||
log.Infof("initializing proxy %s:%d -> remote:%d", proxy.SourceIP, proxy.SourcePort, proxy.DestPort)
|
||||
|
||||
proxyAddCommand := &commonbackend.AddProxy{
|
||||
Type: "addProxy",
|
||||
SourceIP: proxy.SourceIP,
|
||||
SourcePort: proxy.SourcePort,
|
||||
DestPort: proxy.DestPort,
|
||||
Protocol: proxy.Protocol,
|
||||
}
|
||||
|
||||
marshalledProxyCommand, err := commonbackend.Marshal("addProxy", proxyAddCommand)
|
||||
marshalledProxyCommand, err := commonbackend.Marshal(proxyAddCommand)
|
||||
|
||||
if err != nil {
|
||||
log.Errorf("failed to generate start command: %s", err.Error())
|
||||
|
@ -189,7 +182,7 @@ func entrypoint(cCtx *cli.Context) error {
|
|||
continue
|
||||
}
|
||||
|
||||
commandType, commandRaw, err := commonbackend.Unmarshal(sock)
|
||||
commandRaw, err := commonbackend.Unmarshal(sock)
|
||||
|
||||
if err != nil {
|
||||
log.Errorf("failed to read from/unmarshal from socket: %s", err.Error())
|
||||
|
@ -197,12 +190,6 @@ func entrypoint(cCtx *cli.Context) error {
|
|||
continue
|
||||
}
|
||||
|
||||
if commandType != "proxyStatusResponse" {
|
||||
log.Errorf("recieved commandType '%s', expecting 'proxyStatusResponse'", commandType)
|
||||
hasAnyFailed = true
|
||||
continue
|
||||
}
|
||||
|
||||
command, ok := commandRaw.(*commonbackend.ProxyStatusResponse)
|
||||
|
||||
if !ok {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue