goluago

package module
v0.0.0-...-eae39ab Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: MIT Imports: 16 Imported by: 3

README

GoDoc

Lua wrappers for the Go standard library

Wraps Go's standard libraries so they can be used with the go-lua Lua VM implementation.

Most of the packages under pkg expose a single function Open(l *lua.State) that makes the corresponding Go package available to Lua scripts. For example:

import "github.com/Shopify/goluago/pkg/strings"
...
strings.Open(l)
...

allows Lua scripts loaded by l to:

require("goluago/strings")
strings.trim("loll ")
strings.split("cat,dog,elephant,walrus", ",")
strings.replace("oink oink oink", "k", "ky", 2)

To make all supported APIs available to Lua:

import "github.com/Shopify/goluago"
...
goluago.Open(l)
...

The "github.com/Shopify/goluago/util" package provides helper functions to push Go values onto the Lua stack, pull tables of string->string or string->value from the Lua stack to Go, and support variadic arguments.

License

goluago is licensed under the MIT license.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Open

func Open(l *lua.State)

Types

This section is empty.

Jump to

Keyboard shortcuts

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