MCPcopy Create free account
hub / github.com/chanify/chanify / initHttpLua

Function initHttpLua

core/webhook.go:41–51  ·  view source on GitHub ↗
(l *lua.LState, ctx *gin.Context)

Source from the content-addressed store, hash-verified

39}
40
41func initHttpLua(l *lua.LState, ctx *gin.Context) {
42 l.SetField(l.NewTypeMetatable("Request"), "__index", l.SetFuncs(l.NewTable(), luaRequestMethods))
43
44 mt := l.NewTypeMetatable("Context")
45 l.SetField(mt, "__index", l.SetFuncs(l.NewTable(), luaContextMethods))
46
47 lc := l.NewUserData()
48 lc.Value = ctx
49 lc.Metatable = mt
50 l.SetGlobal("ctx", lc)
51}
52
53func getHttpLuaReturn(l *lua.LState) (int, string, string) {
54 code := http.StatusOK

Callers 4

TestLuaCheckHttpBodyFunction · 0.85
TestLuaContextSendFunction · 0.85
TestLuaContextSendFailedFunction · 0.85
handlePostWebhookMethod · 0.85

Calls

no outgoing calls

Tested by 3

TestLuaCheckHttpBodyFunction · 0.68
TestLuaContextSendFunction · 0.68
TestLuaContextSendFailedFunction · 0.68