lua

package
v0.0.0-...-20155fc Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2018 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package lua implements LuaState Manages. It Wraps gopher-lua as runner.

Index

Constants

View Source
const (
	// lua state pool size default to 10
	DEFAULT_LUA_STATE_POOL_SIZE = 10
)

Variables

View Source
var (
	OldLuaPathDefault   = lua.LuaPathDefault
	ErrLuaStatePoolFull = errors.New("lua state pool fulled")
)

Functions

func AddLuaPath

func AddLuaPath(p string) error

add one lua path search to LuaPathDefault

func SetLuaPath

func SetLuaPath(p string) error

Types

type LuaStatePool

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

func (*LuaStatePool) Close

func (lp *LuaStatePool) Close(l *lua.LState)

func (*LuaStatePool) Get

func (lp *LuaStatePool) Get() (*lua.LState, error)

get one lua state from pool

func (*LuaStatePool) New

func (lp *LuaStatePool) New() (*lua.LState, error)

func (*LuaStatePool) NewLuaStatePool

func (lp *LuaStatePool) NewLuaStatePool(whenNew NewFunc, size int) *LuaStatePool

func (*LuaStatePool) Put

func (lp *LuaStatePool) Put(l *lua.LState)

put lua state into pool

func (*LuaStatePool) Shutdown

func (lp *LuaStatePool) Shutdown()

close all lua state

type NewFunc

type NewFunc func(l *lua.LState) error

Jump to

Keyboard shortcuts

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