modular split: move invoke, auth, utils, function CRUD handlers to separate files (2026-05-01)
This commit is contained in:
@@ -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...
|
||||
}
|
||||
Reference in New Issue
Block a user