MCPcopy
hub / github.com/eolinker/goku_lite / Router

Method Router

node/gateway/api.go:28–49  ·  view source on GitHub ↗

Router router

(ctx *common.Context)

Source from the content-addressed store, hash-verified

26
27//Router router
28func (h *API) Router(ctx *common.Context) {
29
30 ctx.SetAPIID(h.apiID)
31 ctx.LogFields[access_field.API] = fmt.Sprintf("\"%d %s\"", h.apiID, h.apiName)
32
33 isAccess := h.accessFlow(ctx)
34 h.accessGlobalFlow(ctx)
35 if !isAccess {
36 return
37 }
38
39 h.app.Execute(ctx)
40
41 isproxy := h.proxyFlow(ctx)
42 h.proxyGlobalFlow(ctx)
43
44 if !isproxy {
45 return
46 }
47
48 return
49}
50
51func (h *API) accessFlow(ctx *common.Context) bool {
52 for _, handler := range h.pluginAccess {

Callers

nothing calls this directly

Calls 6

accessFlowMethod · 0.95
accessGlobalFlowMethod · 0.95
proxyFlowMethod · 0.95
proxyGlobalFlowMethod · 0.95
SetAPIIDMethod · 0.80
ExecuteMethod · 0.65

Tested by

no test coverage detected