httplua

package
v0.0.0-...-7b70c5d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 7, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultBuilder = func(L *lua.LState, req *Request) *lua.LTable {
	t := L.NewTable()
	t.RawSetString("GetID", L.NewFunction(req.GetID))
	t.RawSetString("GetURL", L.NewFunction(req.GetURL))
	t.RawSetString("SetURL", L.NewFunction(req.SetURL))
	t.RawSetString("GetProxy", L.NewFunction(req.GetProxy))
	t.RawSetString("SetProxy", L.NewFunction(req.SetProxy))
	t.RawSetString("GetMethod", L.NewFunction(req.GetMethod))
	t.RawSetString("SetMethod", L.NewFunction(req.SetMethod))
	t.RawSetString("GetBody", L.NewFunction(req.GetBody))
	t.RawSetString("SetBody", L.NewFunction(req.SetBody))
	t.RawSetString("FinishedAt", L.NewFunction(req.FinishedAt))
	t.RawSetString("ExecuteStatus", L.NewFunction(req.ExecuteStatus))
	t.RawSetString("ResetHeader", L.NewFunction(req.ResetHeader))
	t.RawSetString("SetHeader", L.NewFunction(req.SetHeader))
	t.RawSetString("AddHeader", L.NewFunction(req.AddHeader))
	t.RawSetString("DelHeader", L.NewFunction(req.DelHeader))
	t.RawSetString("GetHeader", L.NewFunction(req.GetHeader))
	t.RawSetString("HeaderValues", L.NewFunction(req.HeaderValues))
	t.RawSetString("HeaderFields", L.NewFunction(req.HeaderFields))
	t.RawSetString("ResponseStatusCode", L.NewFunction(req.ResponseStatusCode))
	t.RawSetString("ResponseBody", L.NewFunction(req.ResponseBody))
	t.RawSetString("ResponseHeader", L.NewFunction(req.ResponseHeader))
	t.RawSetString("ResponseHeaderValues", L.NewFunction(req.ResponseHeaderValues))
	t.RawSetString("ResponseHeaderFields", L.NewFunction(req.ResponseHeaderFields))
	t.RawSetString("Execute", L.NewFunction(req.Execute))
	return t
}

Functions

This section is empty.

Types

type Addon

type Addon struct {
	Addon   *httpaddon.Addon
	Builder Builder
}

func Create

func Create(p herbplugin.Plugin) *Addon

func (*Addon) Convert

func (a *Addon) Convert(L *lua.LState) lua.LValue

func (*Addon) NewRequest

func (a *Addon) NewRequest(L *lua.LState) int

func (*Addon) ParseURL

func (a *Addon) ParseURL(L *lua.LState) int

type Builder

type Builder func(L *lua.LState, req *Request) *lua.LTable

type Request

type Request struct {
	Request *httpaddon.Request
}

func (*Request) AddHeader

func (req *Request) AddHeader(L *lua.LState) int

func (*Request) DelHeader

func (req *Request) DelHeader(L *lua.LState) int

func (*Request) Execute

func (req *Request) Execute(L *lua.LState) int

func (*Request) ExecuteStatus

func (req *Request) ExecuteStatus(L *lua.LState) int

func (*Request) FinishedAt

func (req *Request) FinishedAt(L *lua.LState) int

func (*Request) GetBody

func (req *Request) GetBody(L *lua.LState) int

func (*Request) GetHeader

func (req *Request) GetHeader(L *lua.LState) int

func (*Request) GetID

func (req *Request) GetID(L *lua.LState) int

func (*Request) GetMethod

func (req *Request) GetMethod(L *lua.LState) int

func (*Request) GetProxy

func (req *Request) GetProxy(L *lua.LState) int

func (*Request) GetURL

func (req *Request) GetURL(L *lua.LState) int

func (*Request) HeaderFields

func (req *Request) HeaderFields(L *lua.LState) int

func (*Request) HeaderValues

func (req *Request) HeaderValues(L *lua.LState) int

func (*Request) PushStrings

func (req *Request) PushStrings(L *lua.LState, data []string)

func (*Request) ResetHeader

func (req *Request) ResetHeader(L *lua.LState) int

func (*Request) ResponseBody

func (req *Request) ResponseBody(L *lua.LState) int

func (*Request) ResponseHeader

func (req *Request) ResponseHeader(L *lua.LState) int

func (*Request) ResponseHeaderFields

func (req *Request) ResponseHeaderFields(L *lua.LState) int

func (*Request) ResponseHeaderValues

func (req *Request) ResponseHeaderValues(L *lua.LState) int

func (*Request) ResponseStatusCode

func (req *Request) ResponseStatusCode(L *lua.LState) int

func (*Request) SetBody

func (req *Request) SetBody(L *lua.LState) int

func (*Request) SetHeader

func (req *Request) SetHeader(L *lua.LState) int

func (*Request) SetMethod

func (req *Request) SetMethod(L *lua.LState) int

func (*Request) SetProxy

func (req *Request) SetProxy(L *lua.LState) int

func (*Request) SetURL

func (req *Request) SetURL(L *lua.LState) int

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL