Documentation
¶
Overview ¶
Package evmstd offers general-purpose Go standard packages to scripts, beyond the few the VM implements itself. Pass Packages to the compiler and the linker together with the host's own packages:
module, err := evmcompiler.Compile("plugin.go", source, evmstd.Packages()...)
program, err := evm.Link(module, evmstd.Packages()...)
GoX includes them without being asked.
Nothing here reads files, the network, the environment or the operating system. API.md lists what each package exposes and what it leaves out. Most native functions run outside the VM's instruction and allocation budgets, charging only the values they return. bytes.Replace, bytes.ReplaceAll, bytes.Join, and bytes.Repeat charge their output size before allocating (bytes.Repeat also caps output at 16 MiB). The six regexp.Regexp ReplaceAll methods (literal: ReplaceAllLiteral, ReplaceAllLiteralString; capture expansion: ReplaceAll, ReplaceAllString; callback: ReplaceAllFunc, ReplaceAllStringFunc) charge their output against the VM allocation budget. Source packages (cmp, iter, maps, slices, sort) are metered like script code.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConcurrencyPackages ¶
ConcurrencyPackages exposes the cache and its native bindings without the rest of evmstd. Packages already includes these declarations.
func Imports ¶
Imports returns the schemas of the natively bound packages by import path, for evmbind.Options.Imports. A host API that uses time.Duration or *url.URL then shares those types with scripts.
Types ¶
This section is empty.