lua

package module
v0.0.0-...-49be84f Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NotSupport     = errors.New("type not support")
	NotSupportFunc = errors.New("function encoding not support")
)
View Source
var (
	ErrNil = errors.New("nil value")
)
View Source
var (
	Nil = lua.LNil
)
View Source
var (
	TableMappingClass = R.TypeOf((*TableMapping)(nil)).Elem()
)

Functions

func As

func As(vm *VM, src Value, value interface{}) error

func Define

func Define(vm *VM, x *Type)

func GoType

func GoType(x interface{}) R.Type

func LoadModule

func LoadModule(vm *VM, loader ModuleLoader)

func VMFunction

func VMFunction(vm *VM, name string, v interface{}) error

func VMValue

func VMValue(vm *VM, name string, v interface{}) error

Types

type Bool

type Bool = lua.LBool

type Call

type Call struct {
	Args []Value
	// contains filtered or unexported fields
}

func (*Call) ArgError

func (m *Call) ArgError(n int, format string, v ...interface{}) int

func (*Call) Push

func (m *Call) Push(values ...Value) int

func (*Call) Return

func (m *Call) Return(args ...interface{}) int

type Decoder

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

func NewDeocder

func NewDeocder(vm *VM, flags EncodingFlags) *Decoder

func (*Decoder) Decode

func (m *Decoder) Decode(src Value, to interface{}) (err error)

type EncodeChecker

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

func (*EncodeChecker) Encode

func (m *EncodeChecker) Encode(src interface{}) error

type EncodeError

type EncodeError struct {
	What error
	// contains filtered or unexported fields
}

func (*EncodeError) Error

func (m *EncodeError) Error() string

type Encoder

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

func NewEncoder

func NewEncoder(vm *VM, flags EncodingFlags) *Encoder

func (*Encoder) Encode

func (m *Encoder) Encode(src interface{}) (to Value, err error)

type EncodingFlags

type EncodingFlags int
const (
	FlagSkipMethod EncodingFlags = 0x1 << 1
	FlagTyped                    = 0x1 << 2
)

type Function

type Function = lua.LFunction

type GFunction

type GFunction = lua.LGFunction

func VMGFunction

func VMGFunction(i *Invoker) GFunction

type Invoker

type Invoker struct {
	Name    string
	GoFunc  interface{}
	Caller  func(vm *VM) (R.Value, error)
	CheckI  func(i []R.Type)
	CheckO  func(o []R.Type)
	Protect bool
	// contains filtered or unexported fields
}

func (*Invoker) Invoke

func (m *Invoker) Invoke(vm *VM) int

type LGFunction

type LGFunction func(vm *VM) int

type Module

type Module struct {
	Name    string
	Members moduleMembers
	// contains filtered or unexported fields
}

func (*Module) Define

func (m *Module) Define(x *Type)

type ModuleLoader

type ModuleLoader func() *Module

type ModuleMembers

type ModuleMembers struct {
}

type Number

type Number = lua.LNumber

type String

type String = lua.LString

type Table

type Table = lua.LTable

type TableMapping

type TableMapping struct {
}

type Type

type Type struct {
	UUID string
	Name string
	Type R.Type
	// contains filtered or unexported fields
}

func (*Type) GetName

func (m *Type) GetName() string

type TypeLoader

type TypeLoader func() *Type

type Typed

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

type VM

type VM = lua.LState

func New

func New() *VM

type Value

type Value = lua.LValue

Directories

Path Synopsis
lib
std

Jump to

Keyboard shortcuts

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