MCPcopy
hub / github.com/zalando/skipper / setResponseValue

Function setResponseValue

script/script.go:585–602  ·  view source on GitHub ↗
(f filters.FilterContext)

Source from the content-addressed store, hash-verified

583}
584
585func setResponseValue(f filters.FilterContext) func(*lua.LState) int {
586 return func(s *lua.LState) int {
587 key := s.ToString(-2)
588 switch key {
589 case "status_code":
590 v := s.Get(-1)
591 n, ok := v.(lua.LNumber)
592 if !ok {
593 s.RaiseError("unsupported status_code type %v, need a number", v.Type())
594 return 0
595 }
596 f.Response().StatusCode = int(n)
597 default:
598 s.RaiseError("unsupported response field %s", key)
599 }
600 return 0
601 }
602}
603
604func getStateBag(f filters.FilterContext) func(*lua.LState) int {
605 return func(s *lua.LState) int {

Callers 1

getContextValueFunction · 0.85

Calls 2

GetMethod · 0.65
ResponseMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…