MCPcopy
hub / github.com/1Panel-dev/KubePi / titleVariables

Method titleVariables

thirdparty/gotty/server/handlers.go:249–268  ·  view source on GitHub ↗

titleVariables merges maps in a specified order. varUnits are name-keyed maps, whose names will be iterated using order.

(order []string, varUnits map[string]map[string]interface{})

Source from the content-addressed store, hash-verified

247// titleVariables merges maps in a specified order.
248// varUnits are name-keyed maps, whose names will be iterated using order.
249func (server *Server) titleVariables(order []string, varUnits map[string]map[string]interface{}) map[string]interface{} {
250 titleVars := map[string]interface{}{}
251
252 for _, name := range order {
253 vars, ok := varUnits[name]
254 if !ok {
255 panic("title variable name error")
256 }
257 for key, val := range vars {
258 titleVars[key] = val
259 }
260 }
261
262 // safe net for conflicted keys
263 for _, name := range order {
264 titleVars[name] = varUnits[name]
265 }
266
267 return titleVars
268}
269
270func (server *Server) handleKubeConfigApi(w http.ResponseWriter, r *http.Request) {
271 result := ApiResponse{

Callers 2

processWSConnMethod · 0.95
handleIndexMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected