MCPcopy Index your code
hub / github.com/zalando/skipper / newState

Method newState

script/script.go:149–168  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

147}
148
149func (s *script) newState() (*lua.LState, error) {
150 L := lua.NewState(lua.Options{SkipOpenLibs: true})
151
152 for _, m := range s.load {
153 m.load(L)
154 }
155
156 for _, m := range s.preload {
157 m.preload(L)
158 }
159
160 L.Push(L.NewFunctionFromProto(s.proto))
161
162 err := L.PCall(0, lua.MultRet, nil)
163 if err != nil {
164 L.Close()
165 return nil, err
166 }
167 return L, nil
168}
169
170func (s *script) initScript(modules, validSources []string) error {
171 // Compile

Callers 3

getStateMethod · 0.95
initScriptMethod · 0.95
BenchmarkNewStateFunction · 0.80

Calls 3

loadMethod · 0.80
preloadMethod · 0.80
CloseMethod · 0.65

Tested by 1

BenchmarkNewStateFunction · 0.64