stdlib

package
v0.5.7 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2026 License: MIT Imports: 43 Imported by: 0

Documentation

Overview

pkg/stdlib/array.go Array utilities for the Xxlang standard library.

pkg/stdlib/bytes.go Byte manipulation utilities for the Xxlang standard library.

pkg/stdlib/bytesbuffer.go BytesBuffer module for efficient byte buffer operations.

pkg/stdlib/collections.go Collection utilities for the Xxlang standard library.

pkg/stdlib/concurrent.go Concurrency built-in functions for Xxlang

pkg/stdlib/crypto.go Cryptography utilities for the Xxlang standard library. Pure Go implementation using standard library - no CGO required. Includes Charlang-compatible encryption functions (TXTE, TXDEE, TXDEF, AES).

pkg/stdlib/csv.go CSV parsing and generation utilities for the Xxlang standard library.

pkg/stdlib/db.go Database module for Xxlang. Provides database connection, query, and execution capabilities. Supports SQLite, MySQL, PostgreSQL, Oracle, and MSSQL Server. All drivers are pure Go implementations (no CGO required).

Driver names:

  • SQLite: "sqlite"
  • MySQL: "mysql"
  • PostgreSQL: "postgres"
  • Oracle: "oracle"
  • MSSQL Server: "mssql"

pkg/stdlib/debug.go Debug utilities for the Xxlang standard library.

pkg/stdlib/encoding.go Encoding utilities for the Xxlang standard library.

pkg/stdlib/env.go Environment variables and configuration utilities for the Xxlang standard library.

pkg/stdlib/file.go File module for streaming file operations in Xxlang standard library.

pkg/stdlib/fmt.go Advanced formatting utilities for the Xxlang standard library.

pkg/stdlib/fp.go Functional programming utilities for the Xxlang standard library.

Package stdlib provides the standard library modules for Xxlang. This file contains the GUI module for WebView2 support.

pkg/stdlib/io.go I/O utilities for the Xxlang standard library.

pkg/stdlib/json.go JSON utilities for the Xxlang standard library. This module provides comprehensive JSON parsing, serialization, and file operations. The builtin functions toJson and fromJson are aliases for json.stringify and json.parse respectively.

pkg/stdlib/jsonpath.go JSONPath implementation for querying and manipulating JSON objects. JSONPath syntax reference: https://goessner.net/articles/JsonPath/

pkg/stdlib/log.go Logging utilities for the Xxlang standard library.

pkg/stdlib/math.go Standard library math module.

pkg/stdlib/net.go Network utilities for the Xxlang standard library.

pkg/stdlib/os.go OS utilities for the Xxlang standard library.

pkg/stdlib/pdf.go PDF processing module for Xxlang. Provides functions for reading, creating, and manipulating PDF files. Implemented using only Go standard library - no third-party dependencies.

pkg/stdlib/pptx.go PPTX module for Xxlang - PowerPoint file handling.

pkg/stdlib/queue.go Queue module for Xxlang - FIFO data structure.

pkg/stdlib/regex.go Regular expression utilities for the Xxlang standard library. Uses regexp2 for full PCRE support including lookahead/lookbehind.

pkg/stdlib/set.go Set module for Xxlang - unordered collection of unique elements.

pkg/stdlib/sort.go Sorting utilities for the Xxlang standard library.

pkg/stdlib/stdlib.go Standard library modules for Xxlang.

pkg/stdlib/strconv.go String conversion utilities for the Xxlang standard library.

pkg/stdlib/string.go String utilities for the Xxlang standard library.

pkg/stdlib/stringbuilder.go StringBuilder module for efficient string concatenation.

pkg/stdlib/text.go Text processing utilities for the Xxlang standard library.

pkg/stdlib/time.go Time utilities for the Xxlang standard library.

pkg/stdlib/utils.go Utility functions for the Xxlang standard library.

pkg/stdlib/uuid.go UUID generation utilities for the Xxlang standard library.

pkg/stdlib/validate.go Validation utilities for the Xxlang standard library.

pkg/stdlib/xlsx.go XLSX module for Xxlang - Excel file handling.

pkg/stdlib/xml.go XML module for Xxlang - XML document handling.

pkg/stdlib/zip.go ZIP file utilities for the Xxlang standard library. Provides comprehensive ZIP creation, extraction, and manipulation with full UTF-8 support.

UTF-8/Unicode Filename Support: - Modern ZIP tools correctly set the UTF-8 flag for non-ASCII filenames - Go's archive/zip package automatically handles UTF-8 flagged entries - For legacy ZIP files with GBK/CP437 encoded names, use the gbkToUtf8 option - This module includes special handling for Chinese and other Unicode filenames

Index

Constants

This section is empty.

Variables

View Source
var Registry = make(map[string]*Module)

Registry holds all registered standard library modules.

Functions

func Array

func Array(elements ...objects.Object) *objects.Array

Array creates an array object.

func Bool

func Bool(v bool) *objects.Bool

Bool creates a boolean object.

func BuiltinFunc

func BuiltinFunc(fn func(...objects.Object) objects.Object) *objects.Builtin

BuiltinFunc creates a builtin function object.

func Error

func Error(msg string) *objects.Error

Error creates an error object.

func Float

func Float(v float64) *objects.Float

Float creates a float object.

func GetConfigMap added in v0.4.19

func GetConfigMap() map[string]interface{}

GetConfigMap reads the Xxlang configuration and returns it as a Go map. This is useful for accessing config values from Go code before the VM starts. Search path priority: 1. ~/.xxl/settings.json (user home directory) 2. /.xxl/settings.json (Linux/Unix systems) 3. C:\.xxl\settings.json (Windows systems) Returns an empty map if no config file is found.

func Has

func Has(name string) bool

Has checks if a module exists in the registry.

func Int

func Int(v int64) *objects.Int

Int creates an integer object.

func Null

func Null() *objects.Null

Null returns the null object.

func Paths added in v0.4.25

func Paths(obj objects.Object) []string

Paths returns all JSONPath strings that lead to values in the object

func Register

func Register(m *Module)

Register adds a module to the registry.

func SetScriptArgs added in v0.4.19

func SetScriptArgs(args []string)

SetScriptArgs sets the script-specific arguments for scripts to access

func String

func String(v string) *objects.String

String creates a string object.

Types

type CompiledRegex

type CompiledRegex struct {
	Pattern string
	Re      *regexp2.Regexp
}

CompiledRegex represents a compiled regular expression

func (*CompiledRegex) HashKey

func (cr *CompiledRegex) HashKey() objects.HashKey

func (*CompiledRegex) Inspect

func (cr *CompiledRegex) Inspect() string

func (*CompiledRegex) ToBool

func (cr *CompiledRegex) ToBool() *objects.Bool

func (*CompiledRegex) Type

func (cr *CompiledRegex) Type() objects.ObjectType

func (*CompiledRegex) TypeTag

func (cr *CompiledRegex) TypeTag() objects.TypeTag

type JSONPath added in v0.4.25

type JSONPath struct {
	// contains filtered or unexported fields
}

JSONPath represents a parsed JSONPath expression

func ParseJSONPath added in v0.4.25

func ParseJSONPath(path string) (*JSONPath, error)

ParseJSONPath parses a JSONPath expression string into a JSONPath struct

func (*JSONPath) Delete added in v0.4.25

func (jp *JSONPath) Delete(obj objects.Object) (objects.Object, error)

Delete deletes values at the specified path

func (*JSONPath) Get added in v0.4.25

func (jp *JSONPath) Get(obj objects.Object) []objects.Object

Get retrieves values from an object using the JSONPath

func (*JSONPath) GetWithPath added in v0.4.25

func (jp *JSONPath) GetWithPath(obj objects.Object) []JSONPathMatch

GetWithPath retrieves values along with their paths

func (*JSONPath) Set added in v0.4.25

func (jp *JSONPath) Set(obj objects.Object, value objects.Object) (objects.Object, error)

Set sets a value at the specified path

type JSONPathMatch added in v0.4.25

type JSONPathMatch struct {
	Path  string
	Value objects.Object
}

JSONPathMatch represents a match result with its path

type Module

type Module struct {
	Name    string
	Exports map[string]objects.Object
}

Module represents a standard library module.

func Get

func Get(name string) *Module

Get retrieves a module from the registry.

Jump to

Keyboard shortcuts

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