packagelib

package
v0.0.0-...-e0b5347 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2023 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LibLoader = Loader{
	Load: load,
	Name: "package",
}

LibLoader allows loading the package lib.

Functions

This section is empty.

Types

type Loader

type Loader struct {
	// Function that creates the package and returns it
	Load func(r *rt.Runtime) (rt.Value, func())

	// Function that cleans up at the end (optional)
	Cleanup func(r *rt.Runtime)

	// Name of the package
	Name string
}

Loader is used to register libraries

func (Loader) Run

func (l Loader) Run(r *rt.Runtime) func()

Run will create the package, associate it with its name in the global env and cache it.

Jump to

Keyboard shortcuts

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