MCPcopy Create free account
hub / github.com/zalando/skipper / filterContextAsLuaTable

Method filterContextAsLuaTable

script/script.go:323–331  ·  view source on GitHub ↗
(L *lua.LState, f filters.FilterContext)

Source from the content-addressed store, hash-verified

321}
322
323func (s *script) filterContextAsLuaTable(L *lua.LState, f filters.FilterContext) *lua.LTable {
324 // this will be passed as parameter to the lua functions
325 // add metatable to dynamically access fields in the context
326 t := L.CreateTable(0, 0)
327 mt := L.CreateTable(0, 1)
328 mt.RawSetString("__index", L.NewFunction(getContextValue(f)))
329 L.SetMetatable(t, mt)
330 return t
331}
332
333func serveRequest(f filters.FilterContext) func(*lua.LState) int {
334 return func(s *lua.LState) int {

Callers 1

runFuncMethod · 0.95

Calls 1

getContextValueFunction · 0.85

Tested by

no test coverage detected