go_mruby

package module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2021 License: MIT Imports: 1 Imported by: 0

README

mruby module for Go

This Go package let you use mruby interpreter. We use mruby C librarary (clone from https://github.com/mruby/mruby). Mruby license is included and you can find it in file mruby/LICENSE (MIT license). First step: get package by using go get:

go get webimizer.dev/go_mruby

IMPORTANT: When you run go get command you may get error. To fix that, you need to copy file mruby/libmruby.a to your project root directory. Example bash command to run on your project root directory:

export GOPATH=$(go env GOPATH)
mkdir mruby
cp $GOPATH/pkg/mod/webimizer.dev/go_mruby@v1.0.0/mruby/libmruby.a ./mruby/libmruby.a

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Mruby_close added in v1.1.0

func Mruby_close()

Close mruuby interpreter. Call it in the end, when you donot use interpreter anymore

func Mruby_load_from_file added in v1.1.0

func Mruby_load_from_file(filepath string)

Load from .rb file

func Mruby_load_from_file_entry_point added in v1.1.0

func Mruby_load_from_file_entry_point(filepath string, entryPoint string)

Load from .rb file and run entryPoint function

func Mruby_load_from_string

func Mruby_load_from_string(code string)

Run ruby from given string

func Mruby_load_irep_file added in v1.1.0

func Mruby_load_irep_file(filepath string)

load from compilder .mrb file (Compiled using mruby CLI command)

func Mruby_open added in v1.1.0

func Mruby_open()

Open mruby interpreter. Call this funcction first before any other function

Types

This section is empty.

Jump to

Keyboard shortcuts

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