luasrc

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package luasrc provides a wrapper for the low-level Lua C API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type State

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

State represents a Lua state.

func NewState

func NewState() *State

NewState creates a new Lua state and opens the standard libraries.

func (*State) Close

func (s *State) Close()

Close closes the Lua state.

func (*State) Evaluate

func (s *State) Evaluate(ctx context.Context, code string) ([]any, error)

Evaluate executes a string of Lua code and returns its results.

func (*State) Execute

func (s *State) Execute(ctx context.Context, code string) error

Execute executes a string of Lua code.

func (*State) GetGlobal

func (s *State) GetGlobal(ctx context.Context, name string) any

GetGlobal gets a global variable from the Lua state.

Jump to

Keyboard shortcuts

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