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

Function ExampleLuaOptions_enableModules

script/options_test.go:88–133  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

86}
87
88func ExampleLuaOptions_enableModules() {
89 runExampleWithOptions(
90 LuaOptions{
91 Modules: []string{
92 "base._G", "base.pairs", "base.ipairs", "base.print", "base.require",
93 "table.sort", "table.insert",
94 // enable all symbols from "package" module as
95 // additional preloaded modules require it
96 "package",
97 // preload additional module
98 "base64",
99 },
100 },
101 testScript(printTable+`
102 local base64 = require("base64")
103
104 function request()
105 printTable("", _G)
106 printTable("table.", table)
107 printTable("package.", package)
108 printTable("package.preload.", package.preload)
109 end
110 `),
111 )
112 // Output:
113 // _G
114 // ipairs
115 // package
116 // pairs
117 // print
118 // printTable
119 // request
120 // require
121 // table
122 // table.insert
123 // table.sort
124 // package.config
125 // package.cpath
126 // package.loaded
127 // package.loaders
128 // package.loadlib
129 // package.path
130 // package.preload
131 // package.seeall
132 // package.preload.base64
133}
134
135func ExampleLuaOptions_disableAll() {
136 runExampleWithOptions(

Callers

nothing calls this directly

Calls 2

runExampleWithOptionsFunction · 0.85
testScriptFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…