Documentation
¶
Overview ¶
Package ari provides a Goal interpreter with extensions for SQL and HTTP, consumable as a library or via the cmd/ari CLI.
Create a fully-configured Goal context with New:
ctx, err := ari.New(ari.FullOptions())
Embed just the cross-platform subset (no CGo, works in WASM) with:
ctx, err := ari.New(ari.DefaultOptions())
DO NOT EDIT THIS FILE. Generated by the ./scripts/release script.
Index ¶
Constants ¶
const AriVersion = "v0.4.0"
AriVersion is the current version of ari. Accessible at runtime via rt.get"v".
Variables ¶
This section is empty.
Functions ¶
func New ¶ added in v0.3.0
New creates a Goal context configured with the ari extensions requested by opts. The returned context has the following always-enabled extensions:
- Math verbs (cos, sin, sqrt, round, …)
- Base64 verbs (base64.enc, base64.dec, …)
- Zip verbs (zip.open, zip.write)
- Rate-limit verbs (ratelimit.new, ratelimit.take)
- HTTP client verbs (http.client, http.get, http.post, …)
- libs global (embedded libs/)
Platform-specific extensions (OS I/O, SQL) are added when the corresponding Options field is true and the build supports them.
Types ¶
type Options ¶ added in v0.3.0
type Options struct {
// OS enables standard OS/IO verbs (print, say, read, open, run, shell, …).
// Not available in WASM builds; this field is ignored there.
OS bool
// SQL enables the SQL database verbs (sql.open, sql.q, sql.exec, …).
// Requires CGo; not available in WASM builds.
SQL bool
}
Options configures which extensions are loaded into the Goal context returned by New.
func DefaultOptions ¶ added in v0.3.0
func DefaultOptions() Options
DefaultOptions returns a base set of options with only cross-platform (non-CGo) extensions enabled. Suitable for WASM builds and lightweight embeddings that don't require GUI or database access.
func FullOptions ¶ added in v0.3.0
func FullOptions() Options
FullOptions returns options that enable all available extensions, including OS I/O and SQL. SQL requires CGo and is silently omitted in WASM builds regardless of this setting.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
ari
command
ari: a Goal interpreter with extensions for SQL and HTTP.
|
ari: a Goal interpreter with extensions for SQL and HTTP. |
|
ari-wasm
command
Browser REPL for ari – Goal + ari extensions (WASM build).
|
Browser REPL for ari – Goal + ari extensions (WASM build). |
|
Package help provides help text for ari extensions combined with Goal's standard language help.
|
Package help provides help text for ari extensions combined with Goal's standard language help. |
|
Package http provides Goal bindings for making HTTP requests.
|
Package http provides Goal bindings for making HTTP requests. |
|
Package ratelimit provides Goal bindings for leaky-bucket rate limiting.
|
Package ratelimit provides Goal bindings for leaky-bucket rate limiting. |
|
Package sql provides Goal bindings for SQL databases.
|
Package sql provides Goal bindings for SQL databases. |