luaz

package
v0.0.0-...-2efa35c Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const ByPassPackageCode = false
View Source
const Code = `` /* 517-byte string literal not displayed */
View Source
const HandlersReference = `` /* 186-byte string literal not displayed */

Variables

View Source
var EmptyLazyData = lazydata.LazyDataBytes([]byte("{}"))

Functions

func BuildLuazExecutorBuilder

func BuildLuazExecutorBuilder(app xtypes.App) (xtypes.ExecutorBuilder, error)

Types

type CloseItem

type CloseItem struct {
	Closer func() error
	Id     uint16
}

type LuaContextOptions

type LuaContextOptions struct {
	HttpContext *gin.Context
	Params      map[string]string
	HandlerName string
}

type LuaH

type LuaH struct {
	L *lua.LState
	// contains filtered or unexported fields
}

func (*LuaH) AddCloser

func (l *LuaH) AddCloser(closer func() error) uint16

func (*LuaH) Close

func (l *LuaH) Close() error

func (*LuaH) HandleAction

func (l *LuaH) HandleAction(event *xtypes.ActionEvent) error

func (*LuaH) HandleHTTP

func (l *LuaH) HandleHTTP(ctx *gin.Context, handlerName string, params map[string]string) error

func (*LuaH) RemoveCloser

func (l *LuaH) RemoveCloser(id uint16)

type LuaStatePool

type LuaStatePool struct {
	// contains filtered or unexported fields
}

LuaStatePool implements a pool of lua.LState objects.

func NewLuaStatePool

func NewLuaStatePool(opts LuaStatePoolOptions) *LuaStatePool

NewLuaStatePool creates a new LuaStatePool with the specified options.

func (*LuaStatePool) CleanupExpiredStates

func (p *LuaStatePool) CleanupExpiredStates()

func (*LuaStatePool) Close

func (p *LuaStatePool) Close()

Close closes all Lua states in the pool.

func (*LuaStatePool) Get

func (p *LuaStatePool) Get() (*LuaH, error)

func (*LuaStatePool) GetDebugData

func (p *LuaStatePool) GetDebugData() map[string]any

func (*LuaStatePool) Put

func (p *LuaStatePool) Put(L *LuaH) error

Put returns a lua.LState to the pool.

type LuaStatePoolOptions

type LuaStatePoolOptions struct {
	MaxSize     int
	MinSize     int
	MaxOnFlight int
	Ttl         time.Duration
	InitFn      func() (*LuaH, error)
}

LuaStatePoolOptions defines the configuration for a new LuaStatePool.

type LuazExecutor

type LuazExecutor struct {
	// contains filtered or unexported fields
}

func (*LuazExecutor) Cleanup

func (l *LuazExecutor) Cleanup()

func (*LuazExecutor) GetDebugData

func (l *LuazExecutor) GetDebugData() map[string]any

func (*LuazExecutor) HandleAction

func (l *LuazExecutor) HandleAction(event *xtypes.ActionEvent) error

func (*LuazExecutor) HandleHttp

func (l *LuazExecutor) HandleHttp(event *xtypes.HttpEvent) error

type LuazExecutorBuilder

type LuazExecutorBuilder struct {
	// contains filtered or unexported fields
}

func (*LuazExecutorBuilder) Build

func (*LuazExecutorBuilder) Icon

func (b *LuazExecutorBuilder) Icon() string

func (*LuazExecutorBuilder) Name

func (b *LuazExecutorBuilder) Name() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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