major refactor
All checks were successful
Build and Publish / BuildAndDeployAmd64 (push) Successful in 28s
Build and Publish / BuildAndDeploy (push) Successful in 2m18s

This commit is contained in:
matst80
2024-11-13 21:56:40 +01:00
parent 9f7c8227c2
commit abf561c3fe
20 changed files with 310 additions and 1292 deletions

View File

@@ -55,7 +55,7 @@ func ErrorHandler(fn func(w http.ResponseWriter, r *http.Request) error) func(w
}
}
func (s *PoolServer) WriteResult(w http.ResponseWriter, result *CallResult) error {
func (s *PoolServer) WriteResult(w http.ResponseWriter, result *FrameWithPayload) error {
w.Header().Set("Content-Type", "application/json")
w.Header().Set("X-Pod-Name", s.pod_name)
if result.StatusCode != 200 {
@@ -65,11 +65,11 @@ func (s *PoolServer) WriteResult(w http.ResponseWriter, result *CallResult) erro
} else {
w.WriteHeader(http.StatusInternalServerError)
}
w.Write([]byte(result.Data))
w.Write([]byte(result.Payload))
return nil
}
w.WriteHeader(http.StatusOK)
_, err := w.Write(result.Data)
_, err := w.Write(result.Payload)
return err
}