modular split: move invoke, auth, utils, function CRUD handlers to separate files (2026-05-01)

This commit is contained in:
“Naeel”
2026-05-01 12:22:23 +04:00
parent 9995df60d6
commit f1b0369737
5 changed files with 148 additions and 511 deletions
+57
View File
@@ -0,0 +1,57 @@
package api
import (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"io"
"net/http"
"strings"
"time"
"fission-console/internal/fission"
"k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
)
func (s *Server) handleInvokeFunction(w http.ResponseWriter, r *http.Request, name string) {
// ...existing code...
}
func (s *Server) handleFissionFunctionGateway(w http.ResponseWriter, r *http.Request) {
// ...existing code...
}
func (s *Server) invokeInternalFunction(w http.ResponseWriter, r *http.Request, namespace, functionName, extraPath string) {
// ...existing code...
}
func (s *Server) handleInvokeRoute(w http.ResponseWriter, r *http.Request) {
// ...existing code...
}
func buildInternalInvokeURL(routerURL, namespace, functionName string) string {
// ...existing code...
}
func resolveInvokeTimeout(fn *unstructured.Unstructured) time.Duration {
// ...existing code...
}
func shouldForwardRequestBody(method string) bool {
// ...existing code...
}
func copyProxyRequestHeaders(dst, src http.Header) {
// ...existing code...
}
func copyProxyResponseHeaders(dst, src http.Header) {
// ...existing code...
}
func doRequestWithContextTimeout(client *http.Client, req *http.Request) (*http.Response, error) {
// ...existing code...
}