Documentation
¶
Overview ¶
pkg/objects/array.go
pkg/objects/bigfloat.go BigFloat represents an arbitrary-precision floating-point value
pkg/objects/bigint.go BigInt represents an arbitrary-precision integer value
pkg/objects/builtin.go
pkg/objects/builtin_check.go Check/validate and bytes built-in functions for Xxlang
pkg/objects/builtin_collection.go Array and collection enhancement built-in functions for Xxlang
pkg/objects/builtin_compress.go Compression and archive built-in functions for Xxlang
pkg/objects/builtin_crypto.go Encryption helper functions for Charlang compatibility
pkg/objects/builtin_data_format.go Data format built-in functions for Xxlang Note: XML functions moved to xml module, YAML functions moved to yaml module, TOML functions moved to toml module. Use module functions instead: xml.parse(), yaml.parse(), toml.parse(), etc.
pkg/objects/builtin_db.go Database builtin functions for Xxlang. Provides two versions of database functions: 1. String-based functions (Charlang compatible): dbQuery, dbQueryRecs, dbQueryMap, etc. 2. Typed functions (preserve native types): dbQueryTyped, dbQueryRowTyped, etc.
pkg/objects/builtin_encode.go Encoding and encryption related built-in functions for Xxlang
pkg/objects/builtin_env.go Environment and OS information related built-in functions for Xxlang
pkg/objects/builtin_file.go File system related built-in functions for Xxlang
pkg/objects/builtin_file_upload.go Built-in functions for file upload handling in server mode.
pkg/objects/builtin_http.go Built-in functions for HTTP server mode.
pkg/objects/builtin_image.go Image processing built-in functions for Xxlang. Note: genQr, scanQr, getImageInfo, resizeImage have been moved to the 'image' stdlib module. createImage is kept as a builtin function (which is an alias to image.createImage).
pkg/objects/builtin_input.go Clipboard and input built-in functions for Xxlang
pkg/objects/builtin_json.go JSON enhancement built-in functions for Xxlang
pkg/objects/builtin_jwt.go JWT (JSON Web Token) functions for Xxlang Note: genJwtToken and parseJwtToken have been moved to crypto module
pkg/objects/builtin_mail.go Email types for Xxlang (MailClient object type) The mail functions have been moved to the mail module.
pkg/objects/builtin_math.go Math enhancement built-in functions for Xxlang Note: sin, cos, tan, asin, acos, atan, atan2, exp, log, log10, log2, pi, e, degToRad, radToDeg have been removed - use math module instead
pkg/objects/builtin_misc.go Miscellaneous built-in functions for Xxlang (random, temp, url, security)
pkg/objects/builtin_network.go Network communication built-in functions for Xxlang (FTP, SSH) Note: newFtpClient and newSshClient have been moved to ftp and ssh modules. Use ftp.connect() or ssh.connect() instead for one-step connection.
pkg/objects/builtin_regex.go Regular expression related built-in functions for Xxlang
pkg/objects/builtin_string.go String enhancement built-in functions for Xxlang
pkg/objects/builtin_string2.go String processing enhancement built-in functions for Xxlang
pkg/objects/builtin_system.go System command builtin functions for Xxlang. Provides systemCmd, systemCmdDetached, and systemStart functions.
pkg/objects/builtin_system_unix.go Unix-specific system command utilities.
pkg/objects/builtin_task.go Task and scheduling functions for Xxlang. Note: These functions have been moved to the 'task' stdlib module. This file retains the cron parser for use by the task module.
pkg/objects/builtin_testing.go Test assertion built-in functions for Xxlang Note: These functions have been moved to the testing and debug modules. This file is kept for backward compatibility placeholders.
pkg/objects/builtin_time.go Time related built-in functions for Xxlang
pkg/objects/builtin_unicode.go Unicode and text processing built-in functions for Xxlang Note: toPinYin, kanaToRomaji, kanjiToKana, kanjiToRomaji have been moved to locale module
pkg/objects/builtin_util.go Utility built-in functions for Xxlang
pkg/objects/builtin_xlsx.go Excel/XLSX and CSV built-in functions for Xxlang. Note: newExcel, openExcel, readCsv, writeCsv have been moved to xlsx and csv modules. Use xlsx.create(), xlsx.open(), csv.read(), csv.write() instead.
pkg/objects/bytes.go Bytes is an immutable byte sequence object. It represents a read-only []byte and is useful for binary data handling.
pkg/objects/bytes_buffer.go BytesBuffer is a mutable buffer of bytes for efficient byte operations. It's similar to Go's bytes.Buffer type. NOTE: This type is NOT thread-safe. Users must handle concurrency themselves using Mutex or RWMutex if shared across goroutines.
pkg/objects/chars.go
pkg/objects/class.go
pkg/objects/context.go Context object for timeout and cancellation (similar to Go's context package)
pkg/objects/db.go Database object types for Xxlang. Provides database connection, transaction, rows, and statement objects.
pkg/objects/docx.go DOCX object types for Xxlang - Microsoft Word document handling.
pkg/objects/file.go File object type for streaming file operations in Xxlang.
pkg/objects/file_lock_unix.go File locking implementation for Unix-like systems (Linux, macOS, BSD, etc.)
pkg/objects/float.go
pkg/objects/ftp_client.go FtpClient object for Xxlang - FTP client functionality.
pkg/objects/ftp_server.go FtpServer object for Xxlang - FTP server functionality.
pkg/objects/function.go
pkg/objects/html_obj.go HTML types for Xxlang - HTML document and element handling.
pkg/objects/http.go HTTP object types for server mode.
pkg/objects/int.go
pkg/objects/jsonutil.go JSON utility functions for Xxlang objects. These functions are exported for use by both the builtin functions and the stdlib json module.
pkg/objects/line_editor.go LineEditor object for Xxlang - line-based text editing functionality.
pkg/objects/map.go
pkg/objects/methods.go
pkg/objects/methods_pptx.go PPTX methods for Xxlang.
pkg/objects/module.go Module object type for runtime module representation.
pkg/objects/object.go
pkg/objects/orderedmap.go OrderedMap is a map that preserves insertion order and supports reordering.
pkg/objects/pdf.go PDF object types for PDF processing in Xxlang. Implemented using only Go standard library - no third-party dependencies.
pkg/objects/pinyin.go Chinese character to Pinyin converter - pure Go implementation
pkg/objects/pinyin_data.go Auto-generated Chinese character to Pinyin mapping data Contains 20000+ Chinese characters DO NOT EDIT - generated from go-pinyin database
pkg/objects/pptx.go PPTX object types for Xxlang - PowerPoint file handling.
pkg/objects/qrcode.go QR Code generator and decoder - pure Go implementation without external dependencies Based on ISO/IEC 18004 standard
pkg/objects/queue.go Queue type for Xxlang - FIFO data structure with O(1) push/pop operations.
pkg/objects/reader_writer.go Reader and Writer objects for streaming I/O operations.
pkg/objects/scanner.go Scanner object for reading input from stdin or any io.Reader.
pkg/objects/set.go Set type for Xxlang - unordered collection of unique elements.
pkg/objects/sftp_client.go SftpClient object for Xxlang - SFTP client functionality.
pkg/objects/sftp_server.go SftpServer object for Xxlang - SFTP server functionality.
pkg/objects/socket_addr.go SocketAddr object type for network address representation.
pkg/objects/socket_unix.go Socket options implementation for Unix-like systems (Linux, macOS, BSD, etc.)
pkg/objects/ssh_client.go SSHClient object for Xxlang - SSH client functionality.
pkg/objects/string.go
pkg/objects/stringbuilder.go StringBuilder is a mutable string builder for efficient string concatenation. Unlike regular string concatenation which creates a new string each time, StringBuilder uses an internal buffer to accumulate strings efficiently. NOTE: This type is NOT thread-safe. Users must handle concurrency themselves using Mutex or RWMutex if shared across goroutines.
pkg/objects/sync.go Synchronization primitives for concurrent programming
pkg/objects/tcp_client.go TcpClient object type for TCP client connections.
pkg/objects/tcp_server.go TcpServer object type for TCP server operations.
pkg/objects/time_obj.go Time object type for Xxlang
pkg/objects/toml_encoder.go TOML encoder - pure Go implementation
pkg/objects/toml_lexer.go TOML lexer - pure Go implementation
pkg/objects/toml_obj.go TOML document object for Xxlang - pure Go implementation without CGO
pkg/objects/toml_parser.go TOML parser - pure Go implementation
pkg/objects/tube.go Tube object for concurrent communication (similar to Go channels)
pkg/objects/udp_socket.go UdpSocket object type for UDP socket operations.
Package objects defines the object types for Xxlang. This file contains the WebView object type for GUI support.
pkg/objects/xlsx.go XLSX workbook type for Xxlang - Excel file handling.
pkg/objects/xml.go XML types for Xxlang - XML document and node handling.
pkg/objects/yaml_obj.go YAML object types and utility functions for Xxlang. This file implements comprehensive YAML 1.2 parsing and serialization without third-party libraries.
Supported features: - Basic types: strings, integers, floats, booleans, null - Collections: mappings, sequences - Block styles: literal (|), folded (>), with chomping indicators (+,-) and indent indicators - Flow styles: inline mappings {}, inline sequences [] - Anchors and aliases: &anchor, *alias - Merge keys: << - Complex keys: ? explicit key syntax - Tags: !!str, !!int, !!float, !!bool, !!null, !!seq, !!map, !!timestamp, !!binary, !!set, !!omap - Multi-document: --- and ... - Comments: # - Special values: .inf, -.inf, .nan - Number formats: hex (0x), octal (0o), binary (0b), sexagesimal (60:00:00) - Precise error reporting with line and column numbers
Index ¶
- Constants
- Variables
- func ClearInternCache()
- func ColToIndex(col string) int
- func ConvertToPinyin(text string, withTone bool, initialsOnly bool) string
- func ConvertToPinyinEx(text string, toneStyle ToneStyle, initialsOnly bool) string
- func ConvertToPinyinWithSeparator(text string, withTone bool, initialsOnly bool, separator string) string
- func ConvertToPinyinWithSeparatorEx(text string, toneStyle ToneStyle, initialsOnly bool, separator string) string
- func DecodeQRCode(img image.Image) (string, error)
- func DetectYAMLValueType(s string) string
- func EncodeToHTML(obj Object, rootName string) (string, error)
- func EncodeToToml(v interface{}) string
- func EncodeToXML(obj Object, rootName string) (string, error)
- func EncodeToml(root *TomlValue) string
- func ErrIndexOutOfRange(index, length int) error
- func ErrKeyNotFound(key Object) error
- func EscapeHTML(s string) string
- func EscapeHTMLAttr(s string) string
- func EscapeXMLAttr(s string) string
- func EscapeXMLText(s string) string
- func ExtractYAMLAnchors(s string) map[string]Object
- func FormatBigFloat(b *BigFloat) string
- func FormatBigInt(b *BigInt) string
- func GenJwtToken(payload *Map, secret []byte, withType, base64Secret bool, expireSeconds int64) (string, error)
- func GenerateQRCode(data string, level QRCodeLevel, size int) ([]byte, error)
- func GetPinyinInitials(text string) string
- func GetPinyinWithTone(text string) string
- func GetPinyinWithToneNumber(text string) string
- func HexToByte(s string) uint8
- func IndexToCol(index int) string
- func IsCachedInt(val int64) bool
- func IsTruthy(obj Object) bool
- func IsValidKey(s string) bool
- func IsYAMLSet(m *Map) bool
- func JSONToYAML(jsonStr string, indent int) (string, error)
- func JoinYAMLDocuments(docs []Object, indent int) string
- func KanaToRomaji(input string) string
- func KanjiToKana(input string) string
- func KanjiToRomaji(input string) string
- func LoadImageFromReader(r io.Reader) (image.Image, string, error)
- func NewBytesReader(data []byte) io.Reader
- func NewStringReader(s string) io.Reader
- func NormalizeYAML(s string, indent int) (string, error)
- func ObjectToGoValue(obj Object) (interface{}, error)
- func ObjectToJSON(obj Object, opts ObjectToJSONOptions) ([]byte, error)
- func ParseCellRef(ref string) (col string, row int)
- func ParseCronRange(cf *CronField, part string, min, max int) error
- func ParseCronStep(cf *CronField, part string, min, max int) error
- func ParseCronValue(s string, min, max int) (int, error)
- func ParseHexColor(s string) color.Color
- func ParseJwtToken(tokenStr string, secret []byte, base64Secret, noValidate bool) (map[string]interface{}, error)
- func ParseMultipartForm(req *http.Request, maxMemory int64) (map[string][]string, map[string][]*FileUpload, error)
- func PutBufferedFloat(obj *Float)
- func PutBufferedInt(obj *Int)
- func PutBufferedString(obj *String)
- func RegisterFileUploadBuiltins()
- func RegisterHttpBuiltins()
- func ReleaseArray(obj *Array)
- func ReleaseArraySlice(objs []*Array)
- func ReleaseFloat(obj *Float)
- func ReleaseFloatSlice(objs []*Float)
- func ReleaseInt(obj *Int)
- func ReleaseIntSlice(objs []*Int)
- func ReleaseMap(obj *Map)
- func ReleaseMapSlice(objs []*Map)
- func ReleaseOrderedMap(om *OrderedMap)
- func ReleaseString(obj *String)
- func ReleaseStringSlice(objs []*String)
- func ResetArrayPoolStats()
- func ResetFloatPoolStats()
- func ResetGlobalReader()
- func ResetIntPoolStats()
- func ResetMapPoolStats()
- func ResetStringPoolStats()
- func SafePath(baseDir, filename string) (string, error)
- func SanitizeHTML(html string) string
- func Scan2() (Object, Object)
- func Scan3() (Object, Object, Object)
- func ScanRow(rows *sql.Rows, columns []string) (map[string]interface{}, error)
- func SerializeYAML(obj Object, indent int) string
- func SetCallUserFuncImpl(fn func(fnObj Object, args ...Object) (Object, error)) func(Object, ...Object) (Object, error)
- func SetDelegateImpl(fn func(source string) (Object, error)) func(source string) (Object, error)
- func SetLoadPluginImpl(fn func(path string) (Object, error)) func(path string) (Object, error)
- func SetRunCodeImpl(fn func(code string, args *Map) (Object, error)) func(code string, args *Map) (Object, error)
- func SplitYAMLDocuments(s string) []string
- func StripTags(html string) string
- func TestUdpSocket_Bind(t *testing.T)
- func TestUdpSocket_BindAlreadyBound(t *testing.T)
- func TestUdpSocket_BindClosed(t *testing.T)
- func TestUdpSocket_Close(t *testing.T)
- func TestUdpSocket_HashKey(t *testing.T)
- func TestUdpSocket_Inspect(t *testing.T)
- func TestUdpSocket_New(t *testing.T)
- func TestUdpSocket_ReceiveFromBytesClosed(t *testing.T)
- func TestUdpSocket_ReceiveFromBytesUnbound(t *testing.T)
- func TestUdpSocket_ReceiveFromClosed(t *testing.T)
- func TestUdpSocket_ReceiveFromUnbound(t *testing.T)
- func TestUdpSocket_SendToBytesClosed(t *testing.T)
- func TestUdpSocket_SendToClosed(t *testing.T)
- func TestUdpSocket_SetTimeout(t *testing.T)
- func TestUdpSocket_ToBool(t *testing.T)
- func TestUdpSocket_Type(t *testing.T)
- func TestUdpSocket_TypeTag(t *testing.T)
- func ToPinYin(text string, toneStyle ToneStyle, initialsOnly bool, separator string) string
- func UnescapeHTML(s string) string
- func ValidateToml(input string) (bool, string)
- func ValidateYAML(s string) error
- func WarmArrayPool(count int)
- func WarmFloatPool(count int)
- func WarmIntPool(count int)
- func WarmMapPool(count int)
- func WarmStringPool(count int)
- func YAMLToJSON(yamlStr string) (string, error)
- type Array
- type ArrayPoolStats
- type AtomicInt
- func (a *AtomicInt) Add(delta int64) int64
- func (a *AtomicInt) CompareAndSwap(old, new int64) bool
- func (a *AtomicInt) HashKey() HashKey
- func (a *AtomicInt) Inspect() string
- func (a *AtomicInt) Load() int64
- func (a *AtomicInt) Store(val int64)
- func (a *AtomicInt) Swap(new int64) int64
- func (a *AtomicInt) ToBool() *Bool
- func (a *AtomicInt) Type() ObjectType
- func (a *AtomicInt) TypeTag() TypeTag
- type BigFloat
- func (b *BigFloat) Abs() *BigFloat
- func (b *BigFloat) Add(other *BigFloat) *BigFloat
- func (b *BigFloat) AddFloat64(f float64) *BigFloat
- func (b *BigFloat) Ceil() *BigFloat
- func (b *BigFloat) Clone() *BigFloat
- func (b *BigFloat) Cmp(other *BigFloat) int
- func (b *BigFloat) Div(other *BigFloat) *BigFloat
- func (b *BigFloat) DivFloat64(f float64) *BigFloat
- func (b *BigFloat) Floor() *BigFloat
- func (b *BigFloat) HashKey() HashKey
- func (b *BigFloat) Inspect() string
- func (b *BigFloat) IsNegative() bool
- func (b *BigFloat) IsPositive() bool
- func (b *BigFloat) IsZero() bool
- func (b *BigFloat) Mul(other *BigFloat) *BigFloat
- func (b *BigFloat) MulFloat64(f float64) *BigFloat
- func (b *BigFloat) Neg() *BigFloat
- func (b *BigFloat) Precision() uint
- func (b *BigFloat) Round() *BigFloat
- func (b *BigFloat) SetPrecision(prec uint) *BigFloat
- func (b *BigFloat) Sign() int
- func (b *BigFloat) String() string
- func (b *BigFloat) Sub(other *BigFloat) *BigFloat
- func (b *BigFloat) SubFloat64(f float64) *BigFloat
- func (b *BigFloat) ToBigInt() *BigInt
- func (b *BigFloat) ToBool() *Bool
- func (b *BigFloat) ToFloat64() (float64, big.Accuracy)
- func (b *BigFloat) ToInt64() (int64, bool)
- func (b *BigFloat) Type() ObjectType
- func (b *BigFloat) TypeTag() TypeTag
- type BigInt
- func (b *BigInt) Abs() *BigInt
- func (b *BigInt) Add(other *BigInt) *BigInt
- func (b *BigInt) AddInt(n int64) *BigInt
- func (b *BigInt) BitLen() int
- func (b *BigInt) Clone() *BigInt
- func (b *BigInt) Cmp(other *BigInt) int
- func (b *BigInt) Div(other *BigInt) *BigInt
- func (b *BigInt) DivInt(n int64) *BigInt
- func (b *BigInt) HashKey() HashKey
- func (b *BigInt) Inspect() string
- func (b *BigInt) IsNegative() bool
- func (b *BigInt) IsPositive() bool
- func (b *BigInt) IsZero() bool
- func (b *BigInt) Mod(other *BigInt) *BigInt
- func (b *BigInt) ModInt(n int64) *BigInt
- func (b *BigInt) Mul(other *BigInt) *BigInt
- func (b *BigInt) MulInt(n int64) *BigInt
- func (b *BigInt) Neg() *BigInt
- func (b *BigInt) Sign() int
- func (b *BigInt) String() string
- func (b *BigInt) Sub(other *BigInt) *BigInt
- func (b *BigInt) SubInt(n int64) *BigInt
- func (b *BigInt) ToBigFloat() *BigFloat
- func (b *BigInt) ToBool() *Bool
- func (b *BigInt) ToFloat64() float64
- func (b *BigInt) ToInt64() (int64, bool)
- func (b *BigInt) Type() ObjectType
- func (b *BigInt) TypeTag() TypeTag
- type Bool
- type Builtin
- type BuiltinFunction
- type Bytes
- func (b *Bytes) At(index int) (int64, bool)
- func (b *Bytes) Concat(others ...*Bytes) *Bytes
- func (b *Bytes) Contains(sub *Bytes) bool
- func (b *Bytes) Count(sub *Bytes) int
- func (b *Bytes) Equal(other *Bytes) bool
- func (b *Bytes) GetIOReader() io.Reader
- func (b *Bytes) GetMember(name string) Object
- func (b *Bytes) HasPrefix(prefix *Bytes) bool
- func (b *Bytes) HasSuffix(suffix *Bytes) bool
- func (b *Bytes) HashKey() HashKey
- func (b *Bytes) Index(sub *Bytes) int
- func (b *Bytes) Inspect() string
- func (b *Bytes) LastIndex(sub *Bytes) int
- func (b *Bytes) Len() int
- func (b *Bytes) Repeat(n int) *Bytes
- func (b *Bytes) Slice(start, end int) *Bytes
- func (b *Bytes) String() string
- func (b *Bytes) ToArray() *Array
- func (b *Bytes) ToBool() *Bool
- func (b *Bytes) Type() ObjectType
- func (b *Bytes) TypeTag() TypeTag
- type BytesBuffer
- func (bb *BytesBuffer) Bytes() []byte
- func (bb *BytesBuffer) BytesRef() []byte
- func (bb *BytesBuffer) Cap() int
- func (bb *BytesBuffer) Clear()
- func (bb *BytesBuffer) Equals(other *BytesBuffer) bool
- func (bb *BytesBuffer) GetIOReader() *bytesBufferReader
- func (bb *BytesBuffer) GetIOWriter() *bytesBufferWriter
- func (bb *BytesBuffer) Grow(n int)
- func (bb *BytesBuffer) HashKey() HashKey
- func (bb *BytesBuffer) Inspect() string
- func (bb *BytesBuffer) Len() int
- func (bb *BytesBuffer) Peek(n int) []byte
- func (bb *BytesBuffer) Read(p []byte) (int, error)
- func (bb *BytesBuffer) ReadByte() (byte, error)
- func (bb *BytesBuffer) ReadBytes(delim byte) ([]byte, error)
- func (bb *BytesBuffer) ReadFloat32() (float32, error)
- func (bb *BytesBuffer) ReadFloat64() (float64, error)
- func (bb *BytesBuffer) ReadInt16() (int16, error)
- func (bb *BytesBuffer) ReadInt32() (int32, error)
- func (bb *BytesBuffer) ReadInt64() (int64, error)
- func (bb *BytesBuffer) ReadString(delim byte) (string, error)
- func (bb *BytesBuffer) Reset()
- func (bb *BytesBuffer) Seek(offset int64, whence int) int64
- func (bb *BytesBuffer) String() string
- func (bb *BytesBuffer) ToBool() *Bool
- func (bb *BytesBuffer) Truncate(n int)
- func (bb *BytesBuffer) Type() ObjectType
- func (bb *BytesBuffer) TypeTag() TypeTag
- func (bb *BytesBuffer) Write(data []byte) int
- func (bb *BytesBuffer) WriteByte(b byte) error
- func (bb *BytesBuffer) WriteFloat32(v float32) error
- func (bb *BytesBuffer) WriteFloat64(v float64) error
- func (bb *BytesBuffer) WriteInt16(v int16) error
- func (bb *BytesBuffer) WriteInt32(v int32) error
- func (bb *BytesBuffer) WriteInt64(v int64) error
- func (bb *BytesBuffer) WriteString(s string) int
- func (bb *BytesBuffer) WriteTo(other *BytesBuffer) (int64, error)
- type Cell
- type Chars
- func (c *Chars) At(index int) (string, bool)
- func (c *Chars) HashKey() HashKey
- func (c *Chars) Inspect() string
- func (c *Chars) Len() int
- func (c *Chars) Slice(start, end int) *Chars
- func (c *Chars) String() string
- func (c *Chars) ToBool() *Bool
- func (c *Chars) Type() ObjectType
- func (c *Chars) TypeTag() TypeTag
- type Class
- type CompiledFunction
- type Cond
- type Context
- func NewBackgroundContext() *Context
- func NewContext(ctx context.Context, cancel context.CancelFunc) *Context
- func NewContextWithCancel(parent *Context) *Context
- func NewContextWithDeadline(parent *Context, deadline time.Time) *Context
- func NewContextWithTimeout(parent *Context, timeout time.Duration) *Context
- func (c *Context) Cancel()
- func (c *Context) Deadline() (time.Time, bool)
- func (c *Context) DeadlineString() string
- func (c *Context) Done() *Tube
- func (c *Context) Err() error
- func (c *Context) ErrString() string
- func (c *Context) GoContext() context.Context
- func (c *Context) HashKey() HashKey
- func (c *Context) Inspect() string
- func (c *Context) IsDone() bool
- func (c *Context) ToBool() *Bool
- func (c *Context) Type() ObjectType
- func (c *Context) TypeTag() TypeTag
- func (c *Context) Value(key interface{}) interface{}
- type CronField
- type CronSchedule
- type DB
- type DBRows
- func (r *DBRows) Close() error
- func (r *DBRows) Columns() ([]string, error)
- func (r *DBRows) GetMember(name string) Object
- func (r *DBRows) HashKey() HashKey
- func (r *DBRows) Inspect() string
- func (r *DBRows) IsClosed() bool
- func (r *DBRows) ToBool() *Bool
- func (r *DBRows) Type() ObjectType
- func (r *DBRows) TypeTag() TypeTag
- type DBStmt
- type DBTx
- type DocxBookmark
- type DocxChart
- type DocxComment
- type DocxDocument
- func (d *DocxDocument) AddMediaFile(data []byte, ext string) string
- func (d *DocxDocument) AddRelationship(relType, target string) string
- func (d *DocxDocument) Close() error
- func (d *DocxDocument) FindElements(path string) *Array
- func (d *DocxDocument) FindFirstElement(path string) *XMLNode
- func (d *DocxDocument) GetBody() *XMLNode
- func (d *DocxDocument) GetProperties() *DocxProperties
- func (d *DocxDocument) GetXMLDoc() *XMLDocument
- func (d *DocxDocument) HashKey() HashKey
- func (d *DocxDocument) Inspect() string
- func (d *DocxDocument) IsModified() bool
- func (d *DocxDocument) Save(path string) error
- func (d *DocxDocument) SetModified(modified bool)
- func (d *DocxDocument) ToBool() *Bool
- func (d *DocxDocument) ToBytes() ([]byte, error)
- func (d *DocxDocument) Type() ObjectType
- func (d *DocxDocument) TypeTag() TypeTag
- type DocxEndnote
- type DocxFooter
- type DocxFootnote
- type DocxHeader
- type DocxHyperlink
- type DocxImage
- type DocxParagraph
- type DocxProperties
- type DocxRevision
- type DocxRun
- type DocxSection
- type DocxShape
- type DocxStyle
- type DocxTOC
- type DocxTable
- type DocxTableCell
- type DocxTableRow
- type DocxTextBox
- type Environment
- type Error
- type File
- func (f *File) Close() error
- func (f *File) Flush() error
- func (f *File) GetMode() FileMode
- func (f *File) GetName() string
- func (f *File) HashKey() HashKey
- func (f *File) Inspect() string
- func (f *File) IsOpen() bool
- func (f *File) Lock(lockType FileLockType, blocking bool) error
- func (f *File) Read(n int) ([]byte, error)
- func (f *File) ReadAll() ([]byte, error)
- func (f *File) ReadLine() (string, error)
- func (f *File) Seek(offset int64, whence int) (int64, error)
- func (f *File) Stat() (os.FileInfo, error)
- func (f *File) Tell() int64
- func (f *File) ToBool() *Bool
- func (f *File) Truncate(size int64) error
- func (f *File) Type() ObjectType
- func (f *File) TypeTag() TypeTag
- func (f *File) Unlock() error
- func (f *File) Write(data []byte) (int, error)
- func (f *File) WriteString(s string) (int, error)
- type FileInfo
- func (fi *FileInfo) GetModTimeString() string
- func (fi *FileInfo) GetModTimeUnix() int64
- func (fi *FileInfo) GetModeString() string
- func (fi *FileInfo) HashKey() HashKey
- func (fi *FileInfo) Inspect() string
- func (fi *FileInfo) IsRegular() bool
- func (fi *FileInfo) IsSymlink() bool
- func (fi *FileInfo) ToBool() *Bool
- func (fi *FileInfo) Type() ObjectType
- func (fi *FileInfo) TypeTag() TypeTag
- type FileLockType
- type FileMode
- type FileUpload
- func (f *FileUpload) GetMember(name string) Object
- func (f *FileUpload) HashKey() HashKey
- func (f *FileUpload) HashSHA256() (string, error)
- func (f *FileUpload) Inspect() string
- func (f *FileUpload) Open() (multipart.File, error)
- func (f *FileUpload) ReadAll() ([]byte, error)
- func (f *FileUpload) ReadAsString() (string, error)
- func (f *FileUpload) Save(destPath string) (string, error)
- func (f *FileUpload) SaveToDir(dir string, autoRename bool) (string, error)
- func (f *FileUpload) ToBool() *Bool
- func (f *FileUpload) Type() ObjectType
- func (f *FileUpload) TypeTag() TypeTag
- type FileUploadConfig
- type FileUploadResult
- type Float
- type FloatPoolStats
- type FtpClient
- func (c *FtpClient) ChangeDir(path string) error
- func (c *FtpClient) Close() error
- func (c *FtpClient) Connect(host string, port int, user, password string) error
- func (c *FtpClient) ConnectWithConfig(config *FtpConfig) error
- func (c *FtpClient) CurrentDir() (string, error)
- func (c *FtpClient) Delete(remotePath string) error
- func (c *FtpClient) Download(remotePath, localPath string) error
- func (c *FtpClient) Exists(remotePath string) bool
- func (c *FtpClient) GetHost() string
- func (c *FtpClient) GetPort() int
- func (c *FtpClient) GetUser() string
- func (c *FtpClient) HashKey() HashKey
- func (c *FtpClient) Inspect() string
- func (c *FtpClient) IsConnected() bool
- func (c *FtpClient) IsDir(remotePath string) bool
- func (c *FtpClient) IsFile(remotePath string) bool
- func (c *FtpClient) ListDir(remotePath string) ([]FtpFileInfo, error)
- func (c *FtpClient) Mkdir(remotePath string) error
- func (c *FtpClient) MkdirAll(remotePath string) error
- func (c *FtpClient) ModTime(remotePath string) (time.Time, error)
- func (c *FtpClient) Rename(oldPath, newPath string) error
- func (c *FtpClient) Rmdir(remotePath string) error
- func (c *FtpClient) RmdirAll(remotePath string) error
- func (c *FtpClient) SetPassive(enabled bool) error
- func (c *FtpClient) SetType(transferType string) error
- func (c *FtpClient) Size(remotePath string) (int64, error)
- func (c *FtpClient) ToBool() *Bool
- func (c *FtpClient) Type() ObjectType
- func (c *FtpClient) TypeTag() TypeTag
- func (c *FtpClient) Upload(localPath, remotePath string) error
- type FtpConfig
- type FtpFileInfo
- type FtpServer
- func (s *FtpServer) AddUser(username, password, homeDir string) error
- func (s *FtpServer) Create(addr string, config *FtpServerConfig) error
- func (s *FtpServer) HashKey() HashKey
- func (s *FtpServer) Inspect() string
- func (s *FtpServer) IsRunning() bool
- func (s *FtpServer) RemoveUser(username string) error
- func (s *FtpServer) Start() error
- func (s *FtpServer) Stop() error
- func (s *FtpServer) ToBool() *Bool
- func (s *FtpServer) Type() ObjectType
- func (s *FtpServer) TypeTag() TypeTag
- type FtpServerConfig
- type Function
- type Goroutine
- func (g *Goroutine) HashKey() HashKey
- func (g *Goroutine) ID() uint64
- func (g *Goroutine) Inspect() string
- func (g *Goroutine) MarkFinished()
- func (g *Goroutine) MarkPanicked(v interface{})
- func (g *Goroutine) PanicValue() interface{}
- func (g *Goroutine) Status() GoroutineStatus
- func (g *Goroutine) ToBool() *Bool
- func (g *Goroutine) Type() ObjectType
- func (g *Goroutine) TypeTag() TypeTag
- func (g *Goroutine) Wait()
- type GoroutineStatus
- type HTMLDocument
- func (d *HTMLDocument) AddScript(js string, src string)
- func (d *HTMLDocument) AddStyle(css string)
- func (d *HTMLDocument) Body() *HTMLElement
- func (d *HTMLDocument) DocType() string
- func (d *HTMLDocument) Find(selector string) *Array
- func (d *HTMLDocument) FindFirst(selector string) *HTMLElement
- func (d *HTMLDocument) GetElementById(id string) *HTMLElement
- func (d *HTMLDocument) GetElementsByClassName(className string) *Array
- func (d *HTMLDocument) GetElementsByTagName(tag string) *Array
- func (d *HTMLDocument) HashKey() HashKey
- func (d *HTMLDocument) Head() *HTMLElement
- func (d *HTMLDocument) Inspect() string
- func (d *HTMLDocument) QuerySelector(selector string) *HTMLElement
- func (d *HTMLDocument) QuerySelectorAll(selector string) *Array
- func (d *HTMLDocument) Root() *HTMLElement
- func (d *HTMLDocument) Save(path string) error
- func (d *HTMLDocument) SetMeta(name, content string)
- func (d *HTMLDocument) SetRoot(root *HTMLElement)
- func (d *HTMLDocument) SetTitle(title string)
- func (d *HTMLDocument) Title() string
- func (d *HTMLDocument) ToBool() *Bool
- func (d *HTMLDocument) ToIndented() string
- func (d *HTMLDocument) ToMap() *Map
- func (d *HTMLDocument) ToString() string
- func (d *HTMLDocument) Type() ObjectType
- func (d *HTMLDocument) TypeTag() TypeTag
- type HTMLElement
- func (e *HTMLElement) AddClass(className string)
- func (e *HTMLElement) AppendChild(child *HTMLElement)
- func (e *HTMLElement) Attribute(name string) string
- func (e *HTMLElement) Attributes() *Map
- func (e *HTMLElement) ChildCount() int
- func (e *HTMLElement) Children() *Array
- func (e *HTMLElement) Class() string
- func (e *HTMLElement) Clear()
- func (e *HTMLElement) Clone() *HTMLElement
- func (e *HTMLElement) Find(selector string) *Array
- func (e *HTMLElement) FindFirst(selector string) *HTMLElement
- func (e *HTMLElement) FirstChild() *HTMLElement
- func (e *HTMLElement) HasAttribute(name string) bool
- func (e *HTMLElement) HasClass(className string) bool
- func (e *HTMLElement) HashKey() HashKey
- func (e *HTMLElement) ID() string
- func (e *HTMLElement) InnerHTML() string
- func (e *HTMLElement) InsertAfter(newElem, refElem *HTMLElement) bool
- func (e *HTMLElement) InsertBefore(newElem, refElem *HTMLElement) bool
- func (e *HTMLElement) Inspect() string
- func (e *HTMLElement) LastChild() *HTMLElement
- func (e *HTMLElement) NodeType() HTMLNodeType
- func (e *HTMLElement) OuterHTML() string
- func (e *HTMLElement) Parent() *HTMLElement
- func (e *HTMLElement) QuerySelector(selector string) *HTMLElement
- func (e *HTMLElement) QuerySelectorAll(selector string) *Array
- func (e *HTMLElement) Remove()
- func (e *HTMLElement) RemoveAttribute(name string)
- func (e *HTMLElement) RemoveChild(index int) bool
- func (e *HTMLElement) RemoveClass(className string)
- func (e *HTMLElement) ReplaceChild(newElem, oldElem *HTMLElement) bool
- func (e *HTMLElement) SetAttribute(name, value string)
- func (e *HTMLElement) SetClass(class string)
- func (e *HTMLElement) SetID(id string)
- func (e *HTMLElement) SetInnerHTML(html string) error
- func (e *HTMLElement) SetTagName(name string)
- func (e *HTMLElement) SetTextContent(text string)
- func (e *HTMLElement) TagName() string
- func (e *HTMLElement) TextContent() string
- func (e *HTMLElement) ToBool() *Bool
- func (e *HTMLElement) ToIndented() string
- func (e *HTMLElement) ToMap() *Map
- func (e *HTMLElement) ToString() string
- func (e *HTMLElement) ToggleClass(className string)
- func (e *HTMLElement) Type() ObjectType
- func (e *HTMLElement) TypeTag() TypeTag
- type HTMLNodeType
- type HashKey
- type HttpMux
- type HttpReq
- type HttpResp
- type Identifier
- type ImageInfo
- type ImageObj
- type Instance
- type Int
- type IntPoolStats
- type Lexer
- type LineEditor
- func (le *LineEditor) AddLine(text string)
- func (le *LineEditor) AlignLeft(width int)
- func (le *LineEditor) AlignRight(width int)
- func (le *LineEditor) AppendFromFile(path string) error
- func (le *LineEditor) AppendLines(newLines []string)
- func (le *LineEditor) AppendToFile(path string) error
- func (le *LineEditor) Center(width int)
- func (le *LineEditor) CharCount() int
- func (le *LineEditor) Clear()
- func (le *LineEditor) Close()
- func (le *LineEditor) Comment(prefix string)
- func (le *LineEditor) CountEmpty() int
- func (le *LineEditor) Dedent()
- func (le *LineEditor) DeleteLine(n int) bool
- func (le *LineEditor) DeleteLines(start, end int) bool
- func (le *LineEditor) DuplicateLine(n int) bool
- func (le *LineEditor) Find(text string) []int
- func (le *LineEditor) FindAll(text string) []string
- func (le *LineEditor) FindDupes() map[string]int
- func (le *LineEditor) FindFirst(text string) int
- func (le *LineEditor) FindLast(text string) int
- func (le *LineEditor) FindRegex(pattern string) ([]int, error)
- func (le *LineEditor) GetFilePath() string
- func (le *LineEditor) GetLine(n int) (string, bool)
- func (le *LineEditor) GetLines(start, end int) []string
- func (le *LineEditor) Grep(text string) *LineEditor
- func (le *LineEditor) GrepNot(text string) *LineEditor
- func (le *LineEditor) GrepNotRegex(pattern string) (*LineEditor, error)
- func (le *LineEditor) GrepRegex(pattern string) (*LineEditor, error)
- func (le *LineEditor) HashKey() HashKey
- func (le *LineEditor) Head(n int) []string
- func (le *LineEditor) Indent(prefix string)
- func (le *LineEditor) Info() map[string]int
- func (le *LineEditor) InsertLine(n int, text string) bool
- func (le *LineEditor) Inspect() string
- func (le *LineEditor) IsEmpty() bool
- func (le *LineEditor) IsModified() bool
- func (le *LineEditor) Join(sep string) string
- func (le *LineEditor) KeepDupes()
- func (le *LineEditor) LineCount() int
- func (le *LineEditor) MoveLine(from, to int) bool
- func (le *LineEditor) NumberLines(start int)
- func (le *LineEditor) PadLeft(width int, padChar string)
- func (le *LineEditor) PadRight(width int, padChar string)
- func (le *LineEditor) Prefix(prefix string)
- func (le *LineEditor) RemoveBlank()
- func (le *LineEditor) RemoveDupes()
- func (le *LineEditor) RemoveEmpty()
- func (le *LineEditor) Replace(old, new string) int
- func (le *LineEditor) ReplaceFirst(old, new string) bool
- func (le *LineEditor) ReplaceLast(old, new string) bool
- func (le *LineEditor) ReplaceLine(n int, old, new string) int
- func (le *LineEditor) ReplaceRange(start, end int, old, new string) int
- func (le *LineEditor) ReplaceRegex(pattern, new string) (int, error)
- func (le *LineEditor) Reverse()
- func (le *LineEditor) RuneCount() int
- func (le *LineEditor) Sample(n int) *LineEditor
- func (le *LineEditor) Save() error
- func (le *LineEditor) SaveAs(path string) error
- func (le *LineEditor) SelectLines(indices []int) *LineEditor
- func (le *LineEditor) SetFilePath(path string)
- func (le *LineEditor) SetLine(n int, text string) bool
- func (le *LineEditor) SetLines(start int, newLines []string) bool
- func (le *LineEditor) Shuffle()
- func (le *LineEditor) Sort()
- func (le *LineEditor) SortByCol(col int, sep string)
- func (le *LineEditor) SortByColNum(col int, sep string)
- func (le *LineEditor) SortDesc()
- func (le *LineEditor) SortNum()
- func (le *LineEditor) SortNumDesc()
- func (le *LineEditor) SplitLines(sep string)
- func (le *LineEditor) StripPrefix(prefix string)
- func (le *LineEditor) StripSuffix(suffix string)
- func (le *LineEditor) Suffix(suffix string)
- func (le *LineEditor) SwapLines(n1, n2 int) bool
- func (le *LineEditor) Tail(n int) []string
- func (le *LineEditor) TakeLines(start, end int) []string
- func (le *LineEditor) ToBool() *Bool
- func (le *LineEditor) ToLines() []string
- func (le *LineEditor) ToLowerCase()
- func (le *LineEditor) ToText() string
- func (le *LineEditor) ToUpperCase()
- func (le *LineEditor) Trim()
- func (le *LineEditor) TrimLeft()
- func (le *LineEditor) TrimRight()
- func (le *LineEditor) Truncate(maxLen int)
- func (le *LineEditor) TruncateWithEllipsis(maxLen int)
- func (le *LineEditor) Type() ObjectType
- func (le *LineEditor) TypeTag() TypeTag
- func (le *LineEditor) Uncomment(prefix string)
- func (le *LineEditor) Unique()
- func (le *LineEditor) UniqueSorted()
- func (le *LineEditor) ViewAll(showNumber bool) []string
- func (le *LineEditor) ViewLine(n int, showNumber bool) string
- func (le *LineEditor) ViewLines(start, end int, showNumber bool) []string
- func (le *LineEditor) WordCount() int
- type MailClient
- type Map
- type MapPair
- type MapPoolStats
- type MergeRange
- type Module
- type Mutex
- type Null
- type Object
- func CallUserFunc(fn Object, args ...Object) (Object, error)
- func GoValueToObject(v interface{}) Object
- func InterfaceToObject(v interface{}) Object
- func IoCopy(dst *Writer, src *Reader) Object
- func JSONToObject(s string) (Object, error)
- func ParseYAML(s string) (Object, error)
- func ParseYAMLDocuments(s string) ([]Object, error)
- func RowsToArrays(rows *sql.Rows) (Object, error)
- func RowsToMaps(rows *sql.Rows) (Object, error)
- func Scan(prompt string) Object
- func ScanBool(prompt string) Object
- func ScanFloat(prompt string) Object
- func ScanInt(prompt string) Object
- func ScanN(n int) Object
- func ScanSplit(sep string) Object
- func Scanf(format string) Object
- func YAMLPathQuery(obj Object, path string) Object
- func YAMLPathSet(obj Object, path string, value Object) Object
- type ObjectToJSONOptions
- type ObjectType
- type Once
- type OrderedMap
- func (om *OrderedMap) Clone() *OrderedMap
- func (om *OrderedMap) Delete(key Object) bool
- func (om *OrderedMap) Get(key Object) Object
- func (om *OrderedMap) GetAt(index int) (Object, Object, error)
- func (om *OrderedMap) GetIndex(key Object) int
- func (om *OrderedMap) GetOrderedKeys() []Object
- func (om *OrderedMap) GetOrderedPairs() []Object
- func (om *OrderedMap) GetOrderedValues() []Object
- func (om *OrderedMap) HasKey(key Object) bool
- func (om *OrderedMap) HashKey() HashKey
- func (om *OrderedMap) InsertAt(key Object, value Object, index int) error
- func (om *OrderedMap) Inspect() string
- func (om *OrderedMap) Len() int
- func (om *OrderedMap) MoveAfter(key1, key2 Object) error
- func (om *OrderedMap) MoveBefore(key1, key2 Object) error
- func (om *OrderedMap) MoveToBack(key Object) error
- func (om *OrderedMap) MoveToFront(key Object) error
- func (om *OrderedMap) Reverse()
- func (om *OrderedMap) Set(key Object, value Object)
- func (om *OrderedMap) SetAt(index int, value Object) error
- func (om *OrderedMap) SortByKey()
- func (om *OrderedMap) Swap(key1, key2 Object) error
- func (om *OrderedMap) ToBool() *Bool
- func (om *OrderedMap) ToMap() *Map
- func (om *OrderedMap) Type() ObjectType
- func (om *OrderedMap) TypeTag() TypeTag
- type OrderedMapPair
- type PDF
- func (p *PDF) Close() Object
- func (p *PDF) ExtractAllText() Object
- func (p *PDF) ExtractText(pageIndex int) Object
- func (p *PDF) GetInfo() *PDFInfo
- func (p *PDF) GetMember(name string) Object
- func (p *PDF) GetPage(index int) Object
- func (p *PDF) HashKey() HashKey
- func (p *PDF) Inspect() string
- func (p *PDF) Parse() error
- func (p *PDF) RotatePage(pageIndex int, angle int) Object
- func (p *PDF) SaveAs(filePath string) Object
- func (p *PDF) ToBool() *Bool
- func (p *PDF) ToBytes() Object
- func (p *PDF) Type() ObjectType
- func (p *PDF) TypeTag() TypeTag
- type PDFArray
- type PDFDict
- type PDFDocument
- func (d *PDFDocument) AddPage(width, height float64) Object
- func (d *PDFDocument) GetMember(name string) Object
- func (d *PDFDocument) HashKey() HashKey
- func (d *PDFDocument) Inspect() string
- func (d *PDFDocument) Save(filePath string) Object
- func (d *PDFDocument) SetFont(name string, size float64) Object
- func (d *PDFDocument) ToBool() *Bool
- func (d *PDFDocument) ToBytes() Object
- func (d *PDFDocument) Type() ObjectType
- func (d *PDFDocument) TypeTag() TypeTag
- func (d *PDFDocument) WriteText(pageIndex int, text string, x, y float64, opts map[string]interface{}) Object
- type PDFHexStr
- type PDFInfo
- type PDFName
- type PDFObj
- type PDFPage
- type PDFPageData
- type PDFRef
- type PDFStream
- type PDFString
- type PDFXRefEntry
- type PDFXRefTable
- type PPTXAudio
- func (a *PPTXAudio) GetData() []byte
- func (a *PPTXAudio) GetFormat() string
- func (a *PPTXAudio) GetPosition() PPTXPosition
- func (a *PPTXAudio) HashKey() HashKey
- func (a *PPTXAudio) Inspect() string
- func (a *PPTXAudio) Save(path string) error
- func (a *PPTXAudio) SetPosition(x, y int64)
- func (a *PPTXAudio) ToBool() *Bool
- func (a *PPTXAudio) Type() ObjectType
- func (a *PPTXAudio) TypeTag() TypeTag
- type PPTXBulletStyle
- type PPTXCellStyle
- type PPTXChart
- func (c *PPTXChart) GetKind() PPTXChartKind
- func (c *PPTXChart) GetPosition() PPTXPosition
- func (c *PPTXChart) GetSeries() []*PPTXChartSeries
- func (c *PPTXChart) GetSeriesCount() int
- func (c *PPTXChart) GetSize() PPTXSize
- func (c *PPTXChart) GetTitle() string
- func (c *PPTXChart) HashKey() HashKey
- func (c *PPTXChart) Inspect() string
- func (c *PPTXChart) SetPosition(x, y int64)
- func (c *PPTXChart) SetSize(width, height int64)
- func (c *PPTXChart) SetTitle(title string)
- func (c *PPTXChart) ToBool() *Bool
- func (c *PPTXChart) Type() ObjectType
- func (c *PPTXChart) TypeTag() TypeTag
- type PPTXChartData
- type PPTXChartKind
- type PPTXChartSeries
- func (s *PPTXChartSeries) GetName() string
- func (s *PPTXChartSeries) GetValues() []float64
- func (s *PPTXChartSeries) HashKey() HashKey
- func (s *PPTXChartSeries) Inspect() string
- func (s *PPTXChartSeries) SetName(name string)
- func (s *PPTXChartSeries) SetValues(values []float64)
- func (s *PPTXChartSeries) ToBool() *Bool
- func (s *PPTXChartSeries) Type() ObjectType
- func (s *PPTXChartSeries) TypeTag() TypeTag
- type PPTXChartSeriesData
- type PPTXChartStyle
- type PPTXColor
- type PPTXDocument
- func (d *PPTXDocument) AddSlide() *PPTXSlide
- func (d *PPTXDocument) Close() error
- func (d *PPTXDocument) DeleteSlide(index int) bool
- func (d *PPTXDocument) DuplicateSlide(index int) *PPTXSlide
- func (d *PPTXDocument) GetProperties() *PPTXProperties
- func (d *PPTXDocument) GetSlide(index int) *PPTXSlide
- func (d *PPTXDocument) GetSlideCount() int
- func (d *PPTXDocument) GetSlides() []*PPTXSlide
- func (d *PPTXDocument) HashKey() HashKey
- func (d *PPTXDocument) Inspect() string
- func (d *PPTXDocument) MoveSlide(from, to int) bool
- func (d *PPTXDocument) Save(path string) error
- func (d *PPTXDocument) SetProperties(props *PPTXProperties)
- func (d *PPTXDocument) ToBool() *Bool
- func (d *PPTXDocument) ToBytes() ([]byte, error)
- func (d *PPTXDocument) Type() ObjectType
- func (d *PPTXDocument) TypeTag() TypeTag
- type PPTXFont
- type PPTXFormatScheme
- type PPTXGradient
- type PPTXImage
- func (i *PPTXImage) GetData() []byte
- func (i *PPTXImage) GetDataBase64() string
- func (i *PPTXImage) GetFormat() string
- func (i *PPTXImage) GetPosition() PPTXPosition
- func (i *PPTXImage) GetSize() PPTXSize
- func (i *PPTXImage) HashKey() HashKey
- func (i *PPTXImage) Inspect() string
- func (i *PPTXImage) Save(path string) error
- func (i *PPTXImage) SetPosition(x, y int64)
- func (i *PPTXImage) SetSize(width, height int64)
- func (i *PPTXImage) ToBool() *Bool
- func (i *PPTXImage) Type() ObjectType
- func (i *PPTXImage) TypeTag() TypeTag
- type PPTXParagraph
- func (p *PPTXParagraph) GetAlignment() string
- func (p *PPTXParagraph) GetRuns() []*PPTXTextRun
- func (p *PPTXParagraph) GetText() string
- func (p *PPTXParagraph) HashKey() HashKey
- func (p *PPTXParagraph) Inspect() string
- func (p *PPTXParagraph) SetAlignment(align string)
- func (p *PPTXParagraph) ToBool() *Bool
- func (p *PPTXParagraph) Type() ObjectType
- func (p *PPTXParagraph) TypeTag() TypeTag
- type PPTXPosition
- type PPTXProperties
- type PPTXShadow
- type PPTXShape
- func (s *PPTXShape) AddTextFrame(text string) *PPTXTextFrame
- func (s *PPTXShape) GetFill() *PPTXColor
- func (s *PPTXShape) GetKind() PPTXShapeKind
- func (s *PPTXShape) GetPosition() PPTXPosition
- func (s *PPTXShape) GetSize() PPTXSize
- func (s *PPTXShape) GetTextFrame() *PPTXTextFrame
- func (s *PPTXShape) HashKey() HashKey
- func (s *PPTXShape) Inspect() string
- func (s *PPTXShape) SetFill(color string)
- func (s *PPTXShape) SetPosition(x, y int64)
- func (s *PPTXShape) SetSize(width, height int64)
- func (s *PPTXShape) ToBool() *Bool
- func (s *PPTXShape) Type() ObjectType
- func (s *PPTXShape) TypeTag() TypeTag
- type PPTXShapeKind
- type PPTXShapeStyle
- type PPTXSize
- type PPTXSlide
- func (s *PPTXSlide) AddChart(chartKind PPTXChartKind, data PPTXChartData, options map[string]interface{}) *PPTXChart
- func (s *PPTXSlide) AddImage(path string, options map[string]interface{}) *PPTXImage
- func (s *PPTXSlide) AddImageFromBytes(data []byte, format string, options map[string]interface{}) *PPTXImage
- func (s *PPTXSlide) AddShape(shapeKind PPTXShapeKind, options map[string]interface{}) *PPTXShape
- func (s *PPTXSlide) AddTable(rows, cols int, options map[string]interface{}) *PPTXTable
- func (s *PPTXSlide) AddText(text string, options map[string]interface{}) *PPTXTextFrame
- func (s *PPTXSlide) GetAllText() string
- func (s *PPTXSlide) GetCharts() []*PPTXChart
- func (s *PPTXSlide) GetImages() []*PPTXImage
- func (s *PPTXSlide) GetIndex() int
- func (s *PPTXSlide) GetNotes() string
- func (s *PPTXSlide) GetShapes() []*PPTXShape
- func (s *PPTXSlide) GetTables() []*PPTXTable
- func (s *PPTXSlide) GetTexts() []*PPTXTextFrame
- func (s *PPTXSlide) HashKey() HashKey
- func (s *PPTXSlide) Inspect() string
- func (s *PPTXSlide) SetNotes(text string)
- func (s *PPTXSlide) ToBool() *Bool
- func (s *PPTXSlide) Type() ObjectType
- func (s *PPTXSlide) TypeTag() TypeTag
- type PPTXSlideBackground
- type PPTXSlideLayout
- type PPTXSlideMaster
- type PPTXTable
- func (t *PPTXTable) GetCell(row, col int) *PPTXTableCell
- func (t *PPTXTable) GetColCount() int
- func (t *PPTXTable) GetPosition() PPTXPosition
- func (t *PPTXTable) GetRowCount() int
- func (t *PPTXTable) GetSize() PPTXSize
- func (t *PPTXTable) GetValue(row, col int) string
- func (t *PPTXTable) HashKey() HashKey
- func (t *PPTXTable) Inspect() string
- func (t *PPTXTable) SetPosition(x, y int64)
- func (t *PPTXTable) SetSize(width, height int64)
- func (t *PPTXTable) SetValue(row, col int, value string)
- func (t *PPTXTable) ToBool() *Bool
- func (t *PPTXTable) Type() ObjectType
- func (t *PPTXTable) TypeTag() TypeTag
- type PPTXTableCell
- type PPTXTableStyle
- type PPTXTextFrame
- func (tf *PPTXTextFrame) GetParagraphs() []*PPTXParagraph
- func (tf *PPTXTextFrame) GetPosition() PPTXPosition
- func (tf *PPTXTextFrame) GetSize() PPTXSize
- func (tf *PPTXTextFrame) GetText() string
- func (tf *PPTXTextFrame) HashKey() HashKey
- func (tf *PPTXTextFrame) Inspect() string
- func (tf *PPTXTextFrame) SetPosition(x, y int64)
- func (tf *PPTXTextFrame) SetSize(width, height int64)
- func (tf *PPTXTextFrame) SetText(text string)
- func (tf *PPTXTextFrame) ToBool() *Bool
- func (tf *PPTXTextFrame) Type() ObjectType
- func (tf *PPTXTextFrame) TypeTag() TypeTag
- type PPTXTextRun
- func (r *PPTXTextRun) GetColor() string
- func (r *PPTXTextRun) GetFontName() string
- func (r *PPTXTextRun) GetFontSize() int
- func (r *PPTXTextRun) GetText() string
- func (r *PPTXTextRun) HashKey() HashKey
- func (r *PPTXTextRun) Inspect() string
- func (r *PPTXTextRun) IsBold() bool
- func (r *PPTXTextRun) IsItalic() bool
- func (r *PPTXTextRun) SetBold(bold bool)
- func (r *PPTXTextRun) SetColor(hex string)
- func (r *PPTXTextRun) SetFontName(name string)
- func (r *PPTXTextRun) SetFontSize(size int)
- func (r *PPTXTextRun) SetItalic(italic bool)
- func (r *PPTXTextRun) SetText(text string)
- func (r *PPTXTextRun) ToBool() *Bool
- func (r *PPTXTextRun) Type() ObjectType
- func (r *PPTXTextRun) TypeTag() TypeTag
- type PPTXTheme
- type PPTXThemeColors
- type PPTXThemeFonts
- type PPTXVideo
- func (v *PPTXVideo) GetData() []byte
- func (v *PPTXVideo) GetFormat() string
- func (v *PPTXVideo) GetPosition() PPTXPosition
- func (v *PPTXVideo) GetSize() PPTXSize
- func (v *PPTXVideo) HashKey() HashKey
- func (v *PPTXVideo) Inspect() string
- func (v *PPTXVideo) Save(path string) error
- func (v *PPTXVideo) SetPosition(x, y int64)
- func (v *PPTXVideo) SetSize(width, height int64)
- func (v *PPTXVideo) ToBool() *Bool
- func (v *PPTXVideo) Type() ObjectType
- func (v *PPTXVideo) TypeTag() TypeTag
- type Parser
- type QRCode
- type QRCodeLevel
- type QRCodeMode
- type Queue
- func (q *Queue) Clear()
- func (q *Queue) Clone() *Queue
- func (q *Queue) HashKey() HashKey
- func (q *Queue) Inspect() string
- func (q *Queue) IsEmpty() bool
- func (q *Queue) Len() int
- func (q *Queue) Peek() Object
- func (q *Queue) PeekBack() Object
- func (q *Queue) Pop() Object
- func (q *Queue) Push(item Object)
- func (q *Queue) ToArray() *Array
- func (q *Queue) ToBool() *Bool
- func (q *Queue) Type() ObjectType
- func (q *Queue) TypeTag() TypeTag
- type RWMutex
- func (m *RWMutex) HashKey() HashKey
- func (m *RWMutex) Inspect() string
- func (m *RWMutex) Lock()
- func (m *RWMutex) RLock()
- func (m *RWMutex) RUnlock()
- func (m *RWMutex) ToBool() *Bool
- func (m *RWMutex) TryLock() bool
- func (m *RWMutex) TryRLock() bool
- func (m *RWMutex) Type() ObjectType
- func (m *RWMutex) TypeTag() TypeTag
- func (m *RWMutex) Unlock()
- type Reader
- func (r *Reader) Close() Object
- func (r *Reader) GetMember(name string) Object
- func (r *Reader) HashKey() HashKey
- func (r *Reader) Inspect() string
- func (r *Reader) Read(n int) Object
- func (r *Reader) ReadAllBytes() Object
- func (r *Reader) ReadAllStr() Object
- func (r *Reader) ReadLine() Object
- func (r *Reader) ReadStr(n int) Object
- func (r *Reader) ToBool() *Bool
- func (r *Reader) Type() ObjectType
- func (r *Reader) TypeTag() TypeTag
- type Return
- type SSHClient
- func (c *SSHClient) Close() error
- func (c *SSHClient) Connect(host string, port int, user, password string) error
- func (c *SSHClient) ConnectWithConfig(config *SSHConfig) error
- func (c *SSHClient) ConnectWithKey(host string, port int, user, keyPath string) error
- func (c *SSHClient) ConnectWithKeyStr(host string, port int, user, keyStr string) error
- func (c *SSHClient) Download(remotePath, localPath string) error
- func (c *SSHClient) DownloadDir(remoteDir, localDir string) error
- func (c *SSHClient) Exec(cmd string) (string, error)
- func (c *SSHClient) ExecFull(cmd string) (map[string]interface{}, error)
- func (c *SSHClient) ExecStream(cmd string, callback func(line string)) error
- func (c *SSHClient) Exists(remotePath string) bool
- func (c *SSHClient) GetClient() *ssh.Client
- func (c *SSHClient) GetHost() string
- func (c *SSHClient) GetPort() int
- func (c *SSHClient) GetUser() string
- func (c *SSHClient) HashKey() HashKey
- func (c *SSHClient) Inspect() string
- func (c *SSHClient) IsConnected() bool
- func (c *SSHClient) IsDir(remotePath string) bool
- func (c *SSHClient) IsFile(remotePath string) bool
- func (c *SSHClient) ListDir(remotePath string) ([]map[string]interface{}, error)
- func (c *SSHClient) LocalForward(localPort int, remoteHost string, remotePort int) (net.Listener, error)
- func (c *SSHClient) Mkdir(remotePath string) error
- func (c *SSHClient) MkdirAll(remotePath string) error
- func (c *SSHClient) ReadFile(remotePath string) (string, error)
- func (c *SSHClient) Remove(remotePath string) error
- func (c *SSHClient) RemoveDir(remotePath string) error
- func (c *SSHClient) Rename(oldPath, newPath string) error
- func (c *SSHClient) RunScript(scriptPath string) (string, error)
- func (c *SSHClient) RunScriptStr(scriptStr string) (string, error)
- func (c *SSHClient) Stat(remotePath string) (map[string]interface{}, error)
- func (c *SSHClient) ToBool() *Bool
- func (c *SSHClient) Type() ObjectType
- func (c *SSHClient) TypeTag() TypeTag
- func (c *SSHClient) Upload(localPath, remotePath string) error
- func (c *SSHClient) UploadDir(localDir, remoteDir string) error
- func (c *SSHClient) WalkDir(remotePath string) ([]map[string]interface{}, error)
- func (c *SSHClient) WriteFile(remotePath, content string) error
- type SSHConfig
- type Scanner
- type Set
- func (s *Set) Add(item Object) bool
- func (s *Set) Clear()
- func (s *Set) Clone() *Set
- func (s *Set) Contains(item Object) bool
- func (s *Set) Difference(other *Set) *Set
- func (s *Set) Equals(other *Set) bool
- func (s *Set) HashKey() HashKey
- func (s *Set) Inspect() string
- func (s *Set) Intersect(other *Set) *Set
- func (s *Set) IsEmpty() bool
- func (s *Set) IsSubset(other *Set) bool
- func (s *Set) IsSuperset(other *Set) bool
- func (s *Set) Len() int
- func (s *Set) Remove(item Object) bool
- func (s *Set) SymmetricDifference(other *Set) *Set
- func (s *Set) ToArray() *Array
- func (s *Set) ToBool() *Bool
- func (s *Set) ToSortedArray() *Array
- func (s *Set) Type() ObjectType
- func (s *Set) TypeTag() TypeTag
- func (s *Set) Union(other *Set) *Set
- type SftpClient
- func (c *SftpClient) Chmod(remotePath string, mode uint32) error
- func (c *SftpClient) Close() error
- func (c *SftpClient) CloseHandle(handle string) error
- func (c *SftpClient) Connect(host string, port int, user, password string) error
- func (c *SftpClient) ConnectWithConfig(config *SftpConfig) error
- func (c *SftpClient) ConnectWithKey(host string, port int, user, keyPath string) error
- func (c *SftpClient) ConnectWithKeyStr(host string, port int, user, keyStr string) error
- func (c *SftpClient) Create(remotePath string) (string, error)
- func (c *SftpClient) Delete(remotePath string) error
- func (c *SftpClient) Download(remotePath, localPath string) error
- func (c *SftpClient) Exists(remotePath string) bool
- func (c *SftpClient) GetHost() string
- func (c *SftpClient) GetPort() int
- func (c *SftpClient) GetUser() string
- func (c *SftpClient) HashKey() HashKey
- func (c *SftpClient) Inspect() string
- func (c *SftpClient) IsConnected() bool
- func (c *SftpClient) IsDir(remotePath string) bool
- func (c *SftpClient) IsFile(remotePath string) bool
- func (c *SftpClient) ListDir(remotePath string) ([]SftpFileInfo, error)
- func (c *SftpClient) Lstat(remotePath string) (*SftpFileInfo, error)
- func (c *SftpClient) Mkdir(remotePath string) error
- func (c *SftpClient) MkdirAll(remotePath string) error
- func (c *SftpClient) Open(remotePath string) (string, error)
- func (c *SftpClient) OpenFile(remotePath string, flags uint32) (string, error)
- func (c *SftpClient) Read(handle string, offset uint64, length uint32) ([]byte, error)
- func (c *SftpClient) ReadLink(remotePath string) (string, error)
- func (c *SftpClient) RealPath(remotePath string) (string, error)
- func (c *SftpClient) Rename(oldPath, newPath string) error
- func (c *SftpClient) Rmdir(remotePath string) error
- func (c *SftpClient) RmdirAll(remotePath string) error
- func (c *SftpClient) Stat(remotePath string) (*SftpFileInfo, error)
- func (c *SftpClient) Symlink(oldPath, newPath string) error
- func (c *SftpClient) ToBool() *Bool
- func (c *SftpClient) Truncate(remotePath string, size int64) error
- func (c *SftpClient) Type() ObjectType
- func (c *SftpClient) TypeTag() TypeTag
- func (c *SftpClient) Upload(localPath, remotePath string) error
- func (c *SftpClient) Write(handle string, offset uint64, data []byte) error
- type SftpConfig
- type SftpFileInfo
- type SftpServer
- func (s *SftpServer) AddUser(username, password, homeDir string) error
- func (s *SftpServer) AddUserWithKey(username, keyStr, homeDir string) error
- func (s *SftpServer) Create(addr string, config *SftpServerConfig) error
- func (s *SftpServer) HashKey() HashKey
- func (s *SftpServer) Inspect() string
- func (s *SftpServer) IsRunning() bool
- func (s *SftpServer) RemoveUser(username string) error
- func (s *SftpServer) Start() error
- func (s *SftpServer) Stop() error
- func (s *SftpServer) ToBool() *Bool
- func (s *SftpServer) Type() ObjectType
- func (s *SftpServer) TypeTag() TypeTag
- type SftpServerConfig
- type Sheet
- type SocketAddr
- type String
- type StringBuilder
- func (sb *StringBuilder) Cap() int
- func (sb *StringBuilder) Clear()
- func (sb *StringBuilder) GetIOWriter() *stringBuilderWriter
- func (sb *StringBuilder) Grow(n int)
- func (sb *StringBuilder) HashKey() HashKey
- func (sb *StringBuilder) Inspect() string
- func (sb *StringBuilder) Len() int
- func (sb *StringBuilder) Reset()
- func (sb *StringBuilder) String() string
- func (sb *StringBuilder) ToBool() *Bool
- func (sb *StringBuilder) Type() ObjectType
- func (sb *StringBuilder) TypeTag() TypeTag
- func (sb *StringBuilder) Write(s string) int
- func (sb *StringBuilder) WriteLine(s string) int
- type StringPoolStats
- type TcpClient
- func (c *TcpClient) Close() Object
- func (c *TcpClient) Connect(addr string) Object
- func (c *TcpClient) HashKey() HashKey
- func (c *TcpClient) Inspect() string
- func (c *TcpClient) IsClosed() bool
- func (c *TcpClient) LocalAddr() Object
- func (c *TcpClient) Receive(n int) Object
- func (c *TcpClient) ReceiveBytes(n int) Object
- func (c *TcpClient) ReceiveLine() Object
- func (c *TcpClient) RemoteAddr() Object
- func (c *TcpClient) SendBytes(data []byte) Object
- func (c *TcpClient) SendString(data string) Object
- func (c *TcpClient) SetTimeout(ms int) Object
- func (c *TcpClient) ToBool() *Bool
- func (c *TcpClient) Type() ObjectType
- func (c *TcpClient) TypeTag() TypeTag
- type TcpServer
- func (s *TcpServer) Accept(timeoutMs int) Object
- func (s *TcpServer) Addr() *SocketAddr
- func (s *TcpServer) Close() Object
- func (s *TcpServer) HashKey() HashKey
- func (s *TcpServer) Inspect() string
- func (s *TcpServer) IsClosed() bool
- func (s *TcpServer) Listen(addr string) Object
- func (s *TcpServer) OnAccept(callback func(client *TcpClient)) Object
- func (s *TcpServer) SetReuseAddr(reuse bool) Object
- func (s *TcpServer) SetTimeout(ms int) Object
- func (s *TcpServer) Start() Object
- func (s *TcpServer) ToBool() *Bool
- func (s *TcpServer) Type() ObjectType
- func (s *TcpServer) TypeTag() TypeTag
- type Time
- func (t *Time) AddDate(years, months, days int) *Time
- func (t *Time) AddDuration(durStr string) (*Time, error)
- func (t *Time) AddSecs(secs float64) *Time
- func (t *Time) After(other *Time) bool
- func (t *Time) Before(other *Time) bool
- func (t *Time) DiffSecs(other *Time) float64
- func (t *Time) Equal(other *Time) bool
- func (t *Time) Format(layout string) string
- func (t *Time) GetDay() int
- func (t *Time) GetHour() int
- func (t *Time) GetMinute() int
- func (t *Time) GetMonth() int
- func (t *Time) GetNanosecond() int
- func (t *Time) GetSecond() int
- func (t *Time) GetTimestamp() int64
- func (t *Time) GetTimestampMs() int64
- func (t *Time) GetWeekday() int
- func (t *Time) GetYear() int
- func (t *Time) HashKey() HashKey
- func (t *Time) Inspect() string
- func (t *Time) IsZero() bool
- func (t *Time) Sub(other *Time) time.Duration
- func (t *Time) ToBool() *Bool
- func (t *Time) ToMap() *Map
- func (t *Time) Type() ObjectType
- func (t *Time) TypeTag() TypeTag
- type Token
- type TokenType
- type TomlDocument
- func (d *TomlDocument) Get(path string) *TomlValue
- func (d *TomlDocument) Has(path string) bool
- func (d *TomlDocument) HashKey() HashKey
- func (d *TomlDocument) Inspect() string
- func (d *TomlDocument) Keys() []string
- func (d *TomlDocument) Merge(other *TomlDocument) error
- func (d *TomlDocument) Remove(path string) bool
- func (d *TomlDocument) Root() *TomlValue
- func (d *TomlDocument) Save(path string) error
- func (d *TomlDocument) Sections() []string
- func (d *TomlDocument) Set(path string, value *TomlValue) error
- func (d *TomlDocument) ToBool() *Bool
- func (d *TomlDocument) ToIndented() string
- func (d *TomlDocument) ToMap() *Map
- func (d *TomlDocument) ToString() string
- func (d *TomlDocument) Type() ObjectType
- func (d *TomlDocument) TypeTag() TypeTag
- type TomlValue
- func (v *TomlValue) AsArray() ([]*TomlValue, bool)
- func (v *TomlValue) AsBool() (bool, bool)
- func (v *TomlValue) AsFloat() (float64, bool)
- func (v *TomlValue) AsInt() (int64, bool)
- func (v *TomlValue) AsString() (string, bool)
- func (v *TomlValue) AsTable() (map[string]*TomlValue, bool)
- func (v *TomlValue) Contains(key string) bool
- func (v *TomlValue) Get(key string) *TomlValue
- func (v *TomlValue) GetPath(keys ...string) *TomlValue
- func (v *TomlValue) IsArray() bool
- func (v *TomlValue) IsScalar() bool
- func (v *TomlValue) IsTable() bool
- func (v *TomlValue) Keys() []string
- func (v *TomlValue) KeysString() string
- func (v *TomlValue) Len() int
- func (v *TomlValue) Set(key string, value *TomlValue)
- func (v *TomlValue) String() string
- func (v *TomlValue) ToMap() *Map
- func (v *TomlValue) ToXxlangObject() Object
- func (v *TomlValue) TypeName() string
- type TomlValueType
- type ToneStyle
- type Tube
- func (t *Tube) Cap() int
- func (t *Tube) CapMethod(args ...Object) Object
- func (t *Tube) Close()
- func (t *Tube) CloseMethod(args ...Object) Object
- func (t *Tube) ElemType() ObjectType
- func (t *Tube) HashKey() HashKey
- func (t *Tube) ID() uint64
- func (t *Tube) Inspect() string
- func (t *Tube) IsClosed() bool
- func (t *Tube) IsClosedMethod(args ...Object) Object
- func (t *Tube) Len() int
- func (t *Tube) LenMethod(args ...Object) Object
- func (t *Tube) Receive() (Object, bool)
- func (t *Tube) ReceiveMethod(args ...Object) Object
- func (t *Tube) ReflectValue() reflect.Value
- func (t *Tube) Send(val Object) bool
- func (t *Tube) SendMethod(args ...Object) Object
- func (t *Tube) SendWithTimeout(val Object, timeoutMs int) (sent bool, ok bool)
- func (t *Tube) ToBool() *Bool
- func (t *Tube) TryReceive() (Object, bool, bool)
- func (t *Tube) TryReceiveMethod(args ...Object) Object
- func (t *Tube) TrySend(val Object) (sent bool, ok bool)
- func (t *Tube) Type() ObjectType
- func (t *Tube) TypeTag() TypeTag
- type TypeTag
- type UdpSocket
- func (s *UdpSocket) Bind(addr string) Object
- func (s *UdpSocket) Close() Object
- func (s *UdpSocket) HashKey() HashKey
- func (s *UdpSocket) Inspect() string
- func (s *UdpSocket) IsClosed() bool
- func (s *UdpSocket) LocalAddr() Object
- func (s *UdpSocket) ReceiveFrom(bufSize int) (Object, Object)
- func (s *UdpSocket) ReceiveFromBytes(bufSize int) (Object, Object)
- func (s *UdpSocket) SendTo(data string, addr string) Object
- func (s *UdpSocket) SendToBytes(data []byte, addr string) Object
- func (s *UdpSocket) SetTimeout(ms int) Object
- func (s *UdpSocket) ToBool() *Bool
- func (s *UdpSocket) Type() ObjectType
- func (s *UdpSocket) TypeTag() TypeTag
- type WaitGroup
- type WebSocket
- func (ws *WebSocket) Close() Object
- func (ws *WebSocket) HashKey() HashKey
- func (ws *WebSocket) Inspect() string
- func (ws *WebSocket) IsClosed() bool
- func (ws *WebSocket) ReadMessage() Object
- func (ws *WebSocket) SendBinaryMessage(data string) Object
- func (ws *WebSocket) SendCloseMessage() Object
- func (ws *WebSocket) SendTextMessage(text string) Object
- func (ws *WebSocket) ToBool() *Bool
- func (ws *WebSocket) Type() ObjectType
- func (ws *WebSocket) TypeTag() TypeTag
- type WebSocketConn
- type WebView
- func (w *WebView) AddCallback(name string, fn *Function)
- func (w *WebView) Close()
- func (w *WebView) Equals(other Object) *Bool
- func (w *WebView) GetCallback(name string) (*Function, bool)
- func (w *WebView) HashKey() HashKey
- func (w *WebView) Inspect() string
- func (w *WebView) IsClosed() bool
- func (w *WebView) SetClosed(closed bool)
- func (w *WebView) ToBool() *Bool
- func (w *WebView) Type() ObjectType
- func (w *WebView) TypeTag() TypeTag
- type Writer
- func (w *Writer) Close() Object
- func (w *Writer) GetMember(name string) Object
- func (w *Writer) HashKey() HashKey
- func (w *Writer) Inspect() string
- func (w *Writer) ToBool() *Bool
- func (w *Writer) Type() ObjectType
- func (w *Writer) TypeTag() TypeTag
- func (w *Writer) Write(data []byte) Object
- func (w *Writer) WriteBytes(arr *Array) Object
- func (w *Writer) WriteStr(s string) Object
- type XLSX
- func (x *XLSX) Close()
- func (x *XLSX) DeleteCol(sheetName string, col int) error
- func (x *XLSX) DeleteRow(sheetName string, row int) error
- func (x *XLSX) DeleteSheet(name string) bool
- func (x *XLSX) ExtractImage(sheetName string, imageIndex int, outputPath string) error
- func (x *XLSX) GetCell(sheetName, ref string) Object
- func (x *XLSX) GetCellByIndex(sheetName string, row, col int) Object
- func (x *XLSX) GetCol(sheetName string, col int) *Array
- func (x *XLSX) GetColCount(sheetName string) int
- func (x *XLSX) GetImageData(sheetName string, imageIndex int) (string, error)
- func (x *XLSX) GetImages(sheetName string) *Array
- func (x *XLSX) GetMerges(sheetName string) *Array
- func (x *XLSX) GetRange(sheetName, rangeStr string) *Array
- func (x *XLSX) GetRow(sheetName string, row int) *Array
- func (x *XLSX) GetRowCount(sheetName string) int
- func (x *XLSX) GetSheet(name string) *Sheet
- func (x *XLSX) GetSheetByIndex(index int) *Sheet
- func (x *XLSX) GetSheetCount() int
- func (x *XLSX) GetSheetList() []string
- func (x *XLSX) GetSheetName(index int) string
- func (x *XLSX) HashKey() HashKey
- func (x *XLSX) InsertCol(sheetName string, col int) error
- func (x *XLSX) InsertRow(sheetName string, row int) error
- func (x *XLSX) Inspect() string
- func (x *XLSX) MergeCell(sheetName string, startRef, endRef string) error
- func (x *XLSX) NewSheet(name string) bool
- func (x *XLSX) Save(path string) error
- func (x *XLSX) SetCell(sheetName, ref string, value Object) error
- func (x *XLSX) SetCellByIndex(sheetName string, row, col int, value Object) error
- func (x *XLSX) SetRow(sheetName string, row int, values *Array) error
- func (x *XLSX) ToBool() *Bool
- func (x *XLSX) Type() ObjectType
- func (x *XLSX) TypeTag() TypeTag
- func (x *XLSX) UnmergeCell(sheetName string, ref string) error
- type XMLDocument
- func (d *XMLDocument) Encoding() string
- func (d *XMLDocument) Find(path string) *Array
- func (d *XMLDocument) FindElement(path string) *XMLNode
- func (d *XMLDocument) FindFirst(path string) *XMLNode
- func (d *XMLDocument) HashKey() HashKey
- func (d *XMLDocument) Inspect() string
- func (d *XMLDocument) Root() *XMLNode
- func (d *XMLDocument) Save(path string) error
- func (d *XMLDocument) SetRoot(node *XMLNode)
- func (d *XMLDocument) ToBool() *Bool
- func (d *XMLDocument) ToIndented() string
- func (d *XMLDocument) ToMap() *Map
- func (d *XMLDocument) ToString() string
- func (d *XMLDocument) Type() ObjectType
- func (d *XMLDocument) TypeTag() TypeTag
- func (d *XMLDocument) Version() string
- type XMLNode
- func (n *XMLNode) AddChild(child *XMLNode)
- func (n *XMLNode) Attr(name string) string
- func (n *XMLNode) Attrs() *Map
- func (n *XMLNode) ChildCount() int
- func (n *XMLNode) Children() *Array
- func (n *XMLNode) Clear()
- func (n *XMLNode) DelAttr(name string)
- func (n *XMLNode) Find(path string) *Array
- func (n *XMLNode) FindFirst(path string) *XMLNode
- func (n *XMLNode) HashKey() HashKey
- func (n *XMLNode) Inspect() string
- func (n *XMLNode) Name() string
- func (n *XMLNode) Parent() *XMLNode
- func (n *XMLNode) RemoveChild(index int) bool
- func (n *XMLNode) SetAttr(name, value string)
- func (n *XMLNode) SetName(name string)
- func (n *XMLNode) SetText(text string)
- func (n *XMLNode) Text() string
- func (n *XMLNode) ToBool() *Bool
- func (n *XMLNode) ToIndented() string
- func (n *XMLNode) ToMap() *Map
- func (n *XMLNode) ToString() string
- func (n *XMLNode) Type() ObjectType
- func (n *XMLNode) TypeTag() TypeTag
- type YAMLDocument
- type YAMLError
Constants ¶
const ( NS_W = "http://schemas.openxmlformats.org/wordprocessingml/2006/main" NS_R = "http://schemas.openxmlformats.org/officeDocument/2006/relationships" NS_WP = "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" NS_A = "http://schemas.openxmlformats.org/drawingml/2006/main" NS_PIC = "http://schemas.openxmlformats.org/drawingml/2006/picture" NS_V = "urn:schemas-microsoft-com:vml" NS_O = "urn:schemas-microsoft-com:office:office" NS_W10 = "urn:schemas-microsoft-com:office:word" NS_W14 = "http://schemas.microsoft.com/office/word/2010/wordml" NS_W15 = "http://schemas.microsoft.com/office/word/2012/wordml" NS_MC = "http://schemas.openxmlformats.org/markup-compatibility/2006" NS_CT = "http://schemas.openxmlformats.org/package/2006/content-types" NS_RELS = "http://schemas.openxmlformats.org/package/2006/relationships" )
XML Namespaces for DOCX
const ( SeekStart = 0 // Seek relative to start of file SeekCurrent = 1 // Seek relative to current position SeekEnd = 2 // Seek relative to end of file )
Seek constants for use with File.seek()
const ( WebSocketTextMessage = 1 WebSocketBinaryMessage = 2 WebSocketCloseMessage = 8 WebSocketPingMessage = 9 WebSocketPongMessage = 10 )
WebSocketMessageType constants
const ( PPTX_NS_A = "http://schemas.openxmlformats.org/drawingml/2006/main" PPTX_NS_R = "http://schemas.openxmlformats.org/officeDocument/2006/relationships" PPTX_NS_P = "http://schemas.openxmlformats.org/presentationml/2006/main" PPTX_NS_PIC = "http://schemas.openxmlformats.org/drawingml/2006/picture" PPTX_NS_C = "http://schemas.openxmlformats.org/drawingml/2006/chart" PPTX_NS_C_R = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart" PPTX_NS_RELS = "http://schemas.openxmlformats.org/package/2006/relationships" PPTX_NS_CONTENT = "http://schemas.openxmlformats.org/package/2006/content-types" )
XML Namespaces for PPTX
const ( EMU_PER_INCH = 914400 EMU_PER_POINT = 12700 EMU_PER_PIXEL = 9525 // at 96 DPI )
EMU conversion constants (English Metric Units)
const ( SSH_FXP_INIT = 1 SSH_FXP_VERSION = 2 SSH_FXP_OPEN = 3 SSH_FXP_CLOSE = 4 SSH_FXP_READ = 5 SSH_FXP_WRITE = 6 SSH_FXP_LSTAT = 7 SSH_FXP_FSTAT = 8 SSH_FXP_SETSTAT = 9 SSH_FXP_FSETSTAT = 10 SSH_FXP_OPENDIR = 11 SSH_FXP_READDIR = 12 SSH_FXP_REMOVE = 13 SSH_FXP_MKDIR = 14 SSH_FXP_RMDIR = 15 SSH_FXP_REALPATH = 16 SSH_FXP_STAT = 17 SSH_FXP_RENAME = 18 SSH_FXP_READLINK = 19 SSH_FXP_SYMLINK = 20 SSH_FXP_STATUS = 101 SSH_FXP_HANDLE = 102 SSH_FXP_DATA = 103 SSH_FXP_NAME = 104 SSH_FXP_ATTRS = 105 SSH_FXP_EXTENDED = 200 SSH_FXP_EXTENDED_REPLY = 201 )
SFTP packet types
const ( SSH_FXF_READ = 0x00000001 SSH_FXF_WRITE = 0x00000002 SSH_FXF_APPEND = 0x00000004 SSH_FXF_CREAT = 0x00000008 SSH_FXF_TRUNC = 0x00000010 SSH_FXF_EXCL = 0x00000020 )
File open flags
const ( SSH_FILEXFER_ATTR_SIZE = 0x00000001 SSH_FILEXFER_ATTR_UIDGID = 0x00000002 SSH_FILEXFER_ATTR_PERMISSIONS = 0x00000004 SSH_FILEXFER_ATTR_ACMODTIME = 0x00000008 )
File attribute flags
const ( SSH_FX_OK = 0 SSH_FX_EOF = 1 SSH_FX_NO_SUCH_FILE = 2 SSH_FX_PERMISSION_DENIED = 3 SSH_FX_FAILURE = 4 SSH_FX_BAD_MESSAGE = 5 SSH_FX_NO_CONNECTION = 6 SSH_FX_CONNECTION_LOST = 7 SSH_FX_OP_UNSUPPORTED = 8 )
SFTP status codes
const DefaultBigFloatPrecision = 256
DefaultBigFloatPrecision is the default precision for BigFloat values (256 bits)
const IntCacheMax = 100000
IntCacheMax is the maximum cached integer value Extended to cover common loop indices and calculation results
const IntCacheMin = -1000
IntCacheMin is the minimum cached integer value
Variables ¶
var ( ContextCanceled = &Error{Message: "context canceled"} ContextDeadlineExceeded = &Error{Message: "context deadline exceeded"} )
Context error types for Xxlang
var ( FLOAT_ZERO = &Float{Value: 0.0} FLOAT_ONE = &Float{Value: 1.0} FLOAT_NEG_ONE = &Float{Value: -1.0} FLOAT_TWO = &Float{Value: 2.0} FLOAT_HALF = &Float{Value: 0.5} FLOAT_TEN = &Float{Value: 10.0} FLOAT_HUNDRED = &Float{Value: 100.0} FLOAT_THOUSAND = &Float{Value: 1000.0} FLOAT_PI = &Float{Value: 3.14159265358979323846} FLOAT_E = &Float{Value: 2.71828182845904523536} )
Pre-cached common float values Unlike integers, we can only cache a small set due to the infinite nature of floats
var ( TRUE = &Bool{Value: true} FALSE = &Bool{Value: false} )
TRUE and FALSE are singleton boolean values
var ( STRING_EMPTY = &String{Value: ""} STRING_TRUE = &String{Value: "true"} STRING_FALSE = &String{Value: "false"} STRING_NULL = &String{Value: "null"} STRING_INT = &String{Value: "INT"} STRING_FLOAT = &String{Value: "FLOAT"} STRING_BOOL = &String{Value: "BOOL"} STRING_STRING = &String{Value: "STRING"} STRING_ARRAY = &String{Value: "ARRAY"} STRING_MAP = &String{Value: "MAP"} STRING_FUNC = &String{Value: "FUNCTION"} STRING_BUILTIN = &String{Value: "BUILTIN"} STRING_ERROR = &String{Value: "ERROR"} STRING_NIL = &String{Value: "nil"} STRING_ZERO = &String{Value: "0"} STRING_ONE = &String{Value: "1"} STRING_SPACE = &String{Value: " "} STRING_NEWLINE = &String{Value: "\n"} )
Pre-cached common string values
var (
BYTES_EMPTY = &Bytes{Value: []byte{}}
)
Pre-cached common Bytes values
var BuiltinDbClose = &Builtin{ Fn: func(args ...Object) Object { if len(args) != 1 { return newError("wrong number of arguments for dbClose. got=%d, want=1", len(args)) } db, ok := args[0].(*DB) if !ok { return newError("argument to 'dbClose' must be DB, got %s", args[0].Type()) } if err := db.Close(); err != nil { return newError("failed to close database: %v", err) } return NULL }, }
BuiltinDbClose closes a database connection.
var BuiltinDbConnect = &Builtin{ Fn: func(args ...Object) Object { if len(args) < 2 { return newError("wrong number of arguments for dbConnect. got=%d, want=2", len(args)) } driver, ok := args[0].(*String) if !ok { return newError("first argument to 'dbConnect' must be STRING (driver), got %s", args[0].Type()) } connStr, ok := args[1].(*String) if !ok { return newError("second argument to 'dbConnect' must be STRING (connection string), got %s", args[1].Type()) } driverName := driver.Value switch driverName { case "sqlite3": driverName = "sqlite" case "pg", "postgresql": driverName = "postgres" case "sqlserver", "mssqlserver": driverName = "mssql" } db, err := sql.Open(driverName, connStr.Value) if err != nil { return newError("failed to open database: %v", err) } if err := db.Ping(); err != nil { db.Close() return newError("failed to connect to database: %v", err) } return NewDB(db, driverName, connStr.Value) }, }
BuiltinDbConnect connects to a database and returns a DB object.
var BuiltinDbExec = &Builtin{ Fn: func(args ...Object) Object { if len(args) < 2 { return newError("wrong number of arguments for dbExec. got=%d, want>=2", len(args)) } db, ok := args[0].(*DB) if !ok { return newError("first argument to 'dbExec' must be DB, got %s", args[0].Type()) } sqlStmt, ok := args[1].(*String) if !ok { return newError("second argument to 'dbExec' must be STRING, got %s", args[1].Type()) } execArgs := make([]interface{}, len(args)-2) for i, arg := range args[2:] { execArgs[i] = objectToGoValue(arg) } result, err := db.Value.Exec(sqlStmt.Value, execArgs...) if err != nil { return newError("exec failed: %v", err) } lastID, _ := result.LastInsertId() rowsAffected, _ := result.RowsAffected() return NewArray([]Object{ NewInt(lastID), NewInt(rowsAffected), }) }, }
BuiltinDbExec executes a SQL statement (INSERT, UPDATE, DELETE, etc.) Returns: [lastInsertId, rowsAffected]
var BuiltinDbQuery = &Builtin{ Fn: func(args ...Object) Object { if len(args) < 2 { return newError("wrong number of arguments for dbQuery. got=%d, want>=2", len(args)) } db, ok := args[0].(*DB) if !ok { return newError("first argument to 'dbQuery' must be DB, got %s", args[0].Type()) } query, ok := args[1].(*String) if !ok { return newError("second argument to 'dbQuery' must be STRING, got %s", args[1].Type()) } queryArgs := make([]interface{}, len(args)-2) for i, arg := range args[2:] { queryArgs[i] = objectToGoValue(arg) } rows, err := db.Value.Query(query.Value, queryArgs...) if err != nil { return newError("query failed: %v", err) } defer rows.Close() columns, err := rows.Columns() if err != nil { return newError("failed to get columns: %v", err) } var result []Object for rows.Next() { values := make([]interface{}, len(columns)) valuePtrs := make([]interface{}, len(columns)) for i := range values { valuePtrs[i] = &values[i] } if err := rows.Scan(valuePtrs...); err != nil { return newError("scan failed: %v", err) } pairs := make(map[HashKey]MapPair) for i, col := range columns { key := NewString(col) pairs[key.HashKey()] = MapPair{ Key: key, Value: NewString(dbValueToString(values[i])), } } result = append(result, NewMap(pairs)) } if err := rows.Err(); err != nil { return newError("rows error: %v", err) } return NewArray(result) }, }
BuiltinDbQuery executes a SQL query and returns results as an array of maps. All values are converted to strings (Charlang behavior).
var BuiltinDbQueryArrayTyped = &Builtin{ Fn: func(args ...Object) Object { if len(args) < 2 { return newError("wrong number of arguments for dbQueryArrayTyped. got=%d, want>=2", len(args)) } db, ok := args[0].(*DB) if !ok { return newError("first argument to 'dbQueryArrayTyped' must be DB, got %s", args[0].Type()) } query, ok := args[1].(*String) if !ok { return newError("second argument to 'dbQueryArrayTyped' must be STRING, got %s", args[1].Type()) } queryArgs := make([]interface{}, len(args)-2) for i, arg := range args[2:] { queryArgs[i] = objectToGoValue(arg) } rows, err := db.Value.Query(query.Value, queryArgs...) if err != nil { return newError("query failed: %v", err) } defer rows.Close() columns, err := rows.Columns() if err != nil { return newError("failed to get columns: %v", err) } var result []Object for rows.Next() { values := make([]interface{}, len(columns)) valuePtrs := make([]interface{}, len(columns)) for i := range values { valuePtrs[i] = &values[i] } if err := rows.Scan(valuePtrs...); err != nil { return newError("scan failed: %v", err) } rowArray := make([]Object, len(columns)) for i, val := range values { rowArray[i] = dbValueToObjectPreserveType(val) } result = append(result, NewArray(rowArray)) } if err := rows.Err(); err != nil { return newError("rows error: %v", err) } return NewArray(result) }, }
BuiltinDbQueryArrayTyped executes a SQL query and returns results as a 2D array. Native data types are preserved.
var BuiltinDbQueryCount = &Builtin{ Fn: func(args ...Object) Object { if len(args) < 2 { return newError("wrong number of arguments for dbQueryCount. got=%d, want>=2", len(args)) } db, ok := args[0].(*DB) if !ok { return newError("first argument to 'dbQueryCount' must be DB, got %s", args[0].Type()) } query, ok := args[1].(*String) if !ok { return newError("second argument to 'dbQueryCount' must be STRING, got %s", args[1].Type()) } queryArgs := make([]interface{}, len(args)-2) for i, arg := range args[2:] { queryArgs[i] = objectToGoValue(arg) } rows, err := db.Value.Query(query.Value, queryArgs...) if err != nil { return NewInt(-1) } defer rows.Close() if !rows.Next() { return NewInt(-1) } var count int = -1 if err := rows.Scan(&count); err != nil { return NewInt(-1) } return NewInt(int64(count)) }, }
BuiltinDbQueryCount executes a SQL query that returns a single integer value. Returns -1 on error.
var BuiltinDbQueryFloat = &Builtin{ Fn: func(args ...Object) Object { if len(args) < 2 { return newError("wrong number of arguments for dbQueryFloat. got=%d, want>=2", len(args)) } db, ok := args[0].(*DB) if !ok { return newError("first argument to 'dbQueryFloat' must be DB, got %s", args[0].Type()) } query, ok := args[1].(*String) if !ok { return newError("second argument to 'dbQueryFloat' must be STRING, got %s", args[1].Type()) } queryArgs := make([]interface{}, len(args)-2) for i, arg := range args[2:] { queryArgs[i] = objectToGoValue(arg) } rows, err := db.Value.Query(query.Value, queryArgs...) if err != nil { return newError("query failed: %v", err) } defer rows.Close() if !rows.Next() { return &Float{Value: 0} } var val float64 if err := rows.Scan(&val); err != nil { return newError("scan failed: %v", err) } return &Float{Value: val} }, }
BuiltinDbQueryFloat executes a SQL query that returns a single float value.
var BuiltinDbQueryMap = &Builtin{ Fn: func(args ...Object) Object { if len(args) < 3 { return newError("wrong number of arguments for dbQueryMap. got=%d, want>=3", len(args)) } db, ok := args[0].(*DB) if !ok { return newError("first argument to 'dbQueryMap' must be DB, got %s", args[0].Type()) } query, ok := args[1].(*String) if !ok { return newError("second argument to 'dbQueryMap' must be STRING, got %s", args[1].Type()) } keyCol, ok := args[2].(*String) if !ok { return newError("third argument to 'dbQueryMap' must be STRING (key column), got %s", args[2].Type()) } queryArgs := make([]interface{}, len(args)-3) for i, arg := range args[3:] { queryArgs[i] = objectToGoValue(arg) } rows, err := db.Value.Query(query.Value, queryArgs...) if err != nil { return newError("query failed: %v", err) } defer rows.Close() columns, err := rows.Columns() if err != nil { return newError("failed to get columns: %v", err) } keyColIdx := -1 for i, col := range columns { if col == keyCol.Value { keyColIdx = i break } } if keyColIdx < 0 { return newError("key column '%s' not found in result", keyCol.Value) } result := make(map[HashKey]MapPair) for rows.Next() { values := make([]interface{}, len(columns)) valuePtrs := make([]interface{}, len(columns)) for i := range values { valuePtrs[i] = &values[i] } if err := rows.Scan(valuePtrs...); err != nil { return newError("scan failed: %v", err) } pairs := make(map[HashKey]MapPair) for i, col := range columns { key := NewString(col) pairs[key.HashKey()] = MapPair{ Key: key, Value: NewString(dbValueToString(values[i])), } } keyValue := NewString(dbValueToString(values[keyColIdx])) result[keyValue.HashKey()] = MapPair{ Key: keyValue, Value: NewMap(pairs), } } if err := rows.Err(); err != nil { return newError("rows error: %v", err) } return NewMap(result) }, }
BuiltinDbQueryMap executes a SQL query and returns results as a map grouped by a key column. All values are converted to strings. Usage: dbQueryMap(db, sql, keyColumn, args...)
var BuiltinDbQueryMapArray = &Builtin{ Fn: func(args ...Object) Object { if len(args) < 3 { return newError("wrong number of arguments for dbQueryMapArray. got=%d, want>=3", len(args)) } db, ok := args[0].(*DB) if !ok { return newError("first argument to 'dbQueryMapArray' must be DB, got %s", args[0].Type()) } query, ok := args[1].(*String) if !ok { return newError("second argument to 'dbQueryMapArray' must be STRING, got %s", args[1].Type()) } keyCol, ok := args[2].(*String) if !ok { return newError("third argument to 'dbQueryMapArray' must be STRING (key column), got %s", args[2].Type()) } queryArgs := make([]interface{}, len(args)-3) for i, arg := range args[3:] { queryArgs[i] = objectToGoValue(arg) } rows, err := db.Value.Query(query.Value, queryArgs...) if err != nil { return newError("query failed: %v", err) } defer rows.Close() columns, err := rows.Columns() if err != nil { return newError("failed to get columns: %v", err) } keyColIdx := -1 for i, col := range columns { if col == keyCol.Value { keyColIdx = i break } } if keyColIdx < 0 { return newError("key column '%s' not found in result", keyCol.Value) } tempResult := make(map[string][]Object) for rows.Next() { values := make([]interface{}, len(columns)) valuePtrs := make([]interface{}, len(columns)) for i := range values { valuePtrs[i] = &values[i] } if err := rows.Scan(valuePtrs...); err != nil { return newError("scan failed: %v", err) } pairs := make(map[HashKey]MapPair) for i, col := range columns { key := NewString(col) pairs[key.HashKey()] = MapPair{ Key: key, Value: NewString(dbValueToString(values[i])), } } keyValue := dbValueToString(values[keyColIdx]) tempResult[keyValue] = append(tempResult[keyValue], NewMap(pairs)) } if err := rows.Err(); err != nil { return newError("rows error: %v", err) } result := make(map[HashKey]MapPair) for keyStr, arr := range tempResult { keyObj := NewString(keyStr) result[keyObj.HashKey()] = MapPair{ Key: keyObj, Value: NewArray(arr), } } return NewMap(result) }, }
BuiltinDbQueryMapArray executes a SQL query and returns results as a map of arrays grouped by a key column. All values are converted to strings. Usage: dbQueryMapArray(db, sql, keyColumn, args...)
var BuiltinDbQueryOrdered = &Builtin{ Fn: func(args ...Object) Object { if len(args) < 2 { return newError("wrong number of arguments for dbQueryOrdered. got=%d, want>=2", len(args)) } db, ok := args[0].(*DB) if !ok { return newError("first argument to 'dbQueryOrdered' must be DB, got %s", args[0].Type()) } query, ok := args[1].(*String) if !ok { return newError("second argument to 'dbQueryOrdered' must be STRING, got %s", args[1].Type()) } queryArgs := make([]interface{}, len(args)-2) for i, arg := range args[2:] { queryArgs[i] = objectToGoValue(arg) } rows, err := db.Value.Query(query.Value, queryArgs...) if err != nil { return newError("query failed: %v", err) } defer rows.Close() columns, err := rows.Columns() if err != nil { return newError("failed to get columns: %v", err) } var result []Object for rows.Next() { values := make([]interface{}, len(columns)) valuePtrs := make([]interface{}, len(columns)) for i := range values { valuePtrs[i] = &values[i] } if err := rows.Scan(valuePtrs...); err != nil { return newError("scan failed: %v", err) } om := NewOrderedMap() for i, col := range columns { om.Set(NewString(col), NewString(dbValueToString(values[i]))) } result = append(result, om) } if err := rows.Err(); err != nil { return newError("rows error: %v", err) } return NewArray(result) }, }
BuiltinDbQueryOrdered executes a SQL query and returns results as an array of OrderedMaps. Column order is preserved in each OrderedMap. All values are converted to strings.
var BuiltinDbQueryRecs = &Builtin{ Fn: func(args ...Object) Object { if len(args) < 2 { return newError("wrong number of arguments for dbQueryRecs. got=%d, want>=2", len(args)) } db, ok := args[0].(*DB) if !ok { return newError("first argument to 'dbQueryRecs' must be DB, got %s", args[0].Type()) } query, ok := args[1].(*String) if !ok { return newError("second argument to 'dbQueryRecs' must be STRING, got %s", args[1].Type()) } queryArgs := make([]interface{}, len(args)-2) for i, arg := range args[2:] { queryArgs[i] = objectToGoValue(arg) } rows, err := db.Value.Query(query.Value, queryArgs...) if err != nil { return newError("query failed: %v", err) } defer rows.Close() columns, err := rows.Columns() if err != nil { return newError("failed to get columns: %v", err) } var result []Object headerRow := make([]Object, len(columns)) for i, col := range columns { headerRow[i] = NewString(col) } result = append(result, NewArray(headerRow)) for rows.Next() { values := make([]interface{}, len(columns)) valuePtrs := make([]interface{}, len(columns)) for i := range values { valuePtrs[i] = &values[i] } if err := rows.Scan(valuePtrs...); err != nil { return newError("scan failed: %v", err) } rowArray := make([]Object, len(columns)) for i, val := range values { rowArray[i] = NewString(dbValueToString(val)) } result = append(result, NewArray(rowArray)) } if err := rows.Err(); err != nil { return newError("rows error: %v", err) } return NewArray(result) }, }
BuiltinDbQueryRecs executes a SQL query and returns results as a 2D string array. The first row contains column names (Charlang behavior).
var BuiltinDbQueryRowTyped = &Builtin{ Fn: func(args ...Object) Object { if len(args) < 2 { return newError("wrong number of arguments for dbQueryRowTyped. got=%d, want>=2", len(args)) } db, ok := args[0].(*DB) if !ok { return newError("first argument to 'dbQueryRowTyped' must be DB, got %s", args[0].Type()) } query, ok := args[1].(*String) if !ok { return newError("second argument to 'dbQueryRowTyped' must be STRING, got %s", args[1].Type()) } queryArgs := make([]interface{}, len(args)-2) for i, arg := range args[2:] { queryArgs[i] = objectToGoValue(arg) } rows, err := db.Value.Query(query.Value, queryArgs...) if err != nil { return newError("query failed: %v", err) } defer rows.Close() if !rows.Next() { return NULL } columns, err := rows.Columns() if err != nil { return newError("failed to get columns: %v", err) } values := make([]interface{}, len(columns)) valuePtrs := make([]interface{}, len(columns)) for i := range values { valuePtrs[i] = &values[i] } if err := rows.Scan(valuePtrs...); err != nil { return newError("scan failed: %v", err) } pairs := make(map[HashKey]MapPair) for i, col := range columns { key := NewString(col) pairs[key.HashKey()] = MapPair{ Key: key, Value: dbValueToObjectPreserveType(values[i]), } } return NewMap(pairs) }, }
BuiltinDbQueryRowTyped executes a SQL query and returns a single row as a map. Native data types are preserved.
var BuiltinDbQueryString = &Builtin{ Fn: func(args ...Object) Object { if len(args) < 2 { return newError("wrong number of arguments for dbQueryString. got=%d, want>=2", len(args)) } db, ok := args[0].(*DB) if !ok { return newError("first argument to 'dbQueryString' must be DB, got %s", args[0].Type()) } query, ok := args[1].(*String) if !ok { return newError("second argument to 'dbQueryString' must be STRING, got %s", args[1].Type()) } queryArgs := make([]interface{}, len(args)-2) for i, arg := range args[2:] { queryArgs[i] = objectToGoValue(arg) } rows, err := db.Value.Query(query.Value, queryArgs...) if err != nil { return newError("query failed: %v", err) } defer rows.Close() if !rows.Next() { return NewString("") } var val string if err := rows.Scan(&val); err != nil { return newError("scan failed: %v", err) } return NewString(val) }, }
BuiltinDbQueryString executes a SQL query that returns a single string value.
var BuiltinDbQueryTyped = &Builtin{ Fn: func(args ...Object) Object { if len(args) < 2 { return newError("wrong number of arguments for dbQueryTyped. got=%d, want>=2", len(args)) } db, ok := args[0].(*DB) if !ok { return newError("first argument to 'dbQueryTyped' must be DB, got %s", args[0].Type()) } query, ok := args[1].(*String) if !ok { return newError("second argument to 'dbQueryTyped' must be STRING, got %s", args[1].Type()) } queryArgs := make([]interface{}, len(args)-2) for i, arg := range args[2:] { queryArgs[i] = objectToGoValue(arg) } rows, err := db.Value.Query(query.Value, queryArgs...) if err != nil { return newError("query failed: %v", err) } defer rows.Close() columns, err := rows.Columns() if err != nil { return newError("failed to get columns: %v", err) } var result []Object for rows.Next() { values := make([]interface{}, len(columns)) valuePtrs := make([]interface{}, len(columns)) for i := range values { valuePtrs[i] = &values[i] } if err := rows.Scan(valuePtrs...); err != nil { return newError("scan failed: %v", err) } pairs := make(map[HashKey]MapPair) for i, col := range columns { key := NewString(col) pairs[key.HashKey()] = MapPair{ Key: key, Value: dbValueToObjectPreserveType(values[i]), } } result = append(result, NewMap(pairs)) } if err := rows.Err(); err != nil { return newError("rows error: %v", err) } return NewArray(result) }, }
BuiltinDbQueryTyped executes a SQL query and returns results as an array of maps. Native data types are preserved (int, float, bool, string, time).
var BuiltinDbQueryValueTyped = &Builtin{ Fn: func(args ...Object) Object { if len(args) < 2 { return newError("wrong number of arguments for dbQueryValueTyped. got=%d, want>=2", len(args)) } db, ok := args[0].(*DB) if !ok { return newError("first argument to 'dbQueryValueTyped' must be DB, got %s", args[0].Type()) } query, ok := args[1].(*String) if !ok { return newError("second argument to 'dbQueryValueTyped' must be STRING, got %s", args[1].Type()) } queryArgs := make([]interface{}, len(args)-2) for i, arg := range args[2:] { queryArgs[i] = objectToGoValue(arg) } rows, err := db.Value.Query(query.Value, queryArgs...) if err != nil { return newError("query failed: %v", err) } defer rows.Close() if !rows.Next() { return NULL } var value interface{} if err := rows.Scan(&value); err != nil { return newError("scan failed: %v", err) } return dbValueToObjectPreserveType(value) }, }
BuiltinDbQueryValueTyped executes a SQL query that returns a single value. Native data types are preserved.
var BuiltinFormatSQLValue = &Builtin{ Fn: func(args ...Object) Object { if len(args) != 1 { return newError("wrong number of arguments for formatSQLValue. got=%d, want=1", len(args)) } str, ok := args[0].(*String) if !ok { return newError("argument to 'formatSQLValue' must be STRING, got %s", args[0].Type()) } result := strings.Replace(str.Value, "\r", "\\r", -1) result = strings.Replace(result, "\n", "\\n", -1) result = strings.Replace(result, "'", "''", -1) return NewString(result) }, }
BuiltinFormatSQLValue escapes special characters in a string for safe SQL usage.
var BuiltinSystemCmd = &Builtin{ Fn: func(args ...Object) Object { if len(args) < 1 { return newError("wrong number of arguments for systemCmd. got=%d, want>=1", len(args)) } cmdStr, ok := args[0].(*String) if !ok { return newError("first argument to 'systemCmd' must be STRING, got %s", args[0].Type()) } // Build command arguments var cmdArgs []string for i := 1; i < len(args); i++ { if arg, ok := args[i].(*String); ok { cmdArgs = append(cmdArgs, arg.Value) } else { return newError("argument %d to 'systemCmd' must be STRING, got %s", i+1, args[i].Type()) } } // Execute command var cmd *exec.Cmd if runtime.GOOS == "windows" { if len(cmdArgs) > 0 { cmd = exec.Command(cmdStr.Value, cmdArgs...) } else { cmd = exec.Command("cmd", "/c", cmdStr.Value) } } else { if len(cmdArgs) > 0 { cmd = exec.Command(cmdStr.Value, cmdArgs...) } else { cmd = exec.Command("sh", "-c", cmdStr.Value) } } // Capture output var stdout, stderr bytes.Buffer cmd.Stdout = &stdout cmd.Stderr = &stderr cmd.Stdin = nil err := cmd.Run() output := stdout.String() + stderr.String() result := NewOrderedMap() result.Set(NewString("output"), NewString(output)) if err != nil { if exitErr, ok := err.(*exec.ExitError); ok { result.Set(NewString("success"), FALSE) result.Set(NewString("exitCode"), NewInt(int64(exitErr.ExitCode()))) result.Set(NewString("error"), NewString(err.Error())) } else { result.Set(NewString("success"), FALSE) result.Set(NewString("exitCode"), NewInt(-1)) result.Set(NewString("error"), NewString(err.Error())) } } else { result.Set(NewString("success"), TRUE) result.Set(NewString("exitCode"), NewInt(0)) result.Set(NewString("error"), NewString("")) } return result }, }
BuiltinSystemCmd executes a system command synchronously and returns the result. Usage: systemCmd(cmd) or systemCmd(cmd, args...) Returns a map with:
- "success": bool - whether the command succeeded
- "exitCode": int - the exit code
- "output": string - combined stdout and stderr
- "error": string - error message if any
var BuiltinSystemCmdDetached = &Builtin{ Fn: func(args ...Object) Object { if len(args) < 1 { return newError("wrong number of arguments for systemCmdDetached. got=%d, want>=1", len(args)) } cmdStr, ok := args[0].(*String) if !ok { return newError("first argument to 'systemCmdDetached' must be STRING, got %s", args[0].Type()) } // Build command arguments var cmdArgs []string for i := 1; i < len(args); i++ { if arg, ok := args[i].(*String); ok { cmdArgs = append(cmdArgs, arg.Value) } else { return newError("argument %d to 'systemCmdDetached' must be STRING, got %s", i+1, args[i].Type()) } } // Create command var cmd *exec.Cmd if runtime.GOOS == "windows" { if len(cmdArgs) > 0 { cmd = exec.Command(cmdStr.Value, cmdArgs...) } else { cmd = exec.Command("cmd", "/c", cmdStr.Value) } } else { if len(cmdArgs) > 0 { cmd = exec.Command(cmdStr.Value, cmdArgs...) } else { cmd = exec.Command("sh", "-c", cmdStr.Value) } } cmd.Stdin = nil cmd.Stdout = nil cmd.Stderr = nil setDetachedAttr(cmd) err := cmd.Start() result := NewOrderedMap() if err != nil { result.Set(NewString("success"), FALSE) result.Set(NewString("pid"), NewInt(0)) result.Set(NewString("error"), NewString(err.Error())) return result } pid := 0 if cmd.Process != nil { pid = cmd.Process.Pid } cmd.Process.Release() result.Set(NewString("success"), TRUE) result.Set(NewString("pid"), NewInt(int64(pid))) result.Set(NewString("error"), NewString("")) return result }, }
BuiltinSystemCmdDetached executes a system command in detached mode (asynchronously). The command runs in the background without waiting for completion. Usage: systemCmdDetached(cmd) or systemCmdDetached(cmd, args...) Returns a map with:
- "success": bool - whether the command was started successfully
- "pid": int - process ID (0 if not available)
- "error": string - error message if any
var BuiltinSystemStart = &Builtin{ Fn: func(args ...Object) Object { if len(args) < 1 { return newError("wrong number of arguments for systemStart. got=%d, want>=1", len(args)) } pathStr, ok := args[0].(*String) if !ok { return newError("first argument to 'systemStart' must be STRING, got %s", args[0].Type()) } path := pathStr.Value // Optional working directory var workingDir string if len(args) >= 2 { if wd, ok := args[1].(*String); ok { workingDir = wd.Value } } var err error switch runtime.GOOS { case "windows": cmd := exec.Command("cmd", "/c", path) if workingDir != "" { cmd.Dir = workingDir } cmd.Stdout = nil cmd.Stderr = nil setDetachedAttr(cmd) err := cmd.Start() if err != nil { result := NewOrderedMap() result.Set(NewString("success"), FALSE) result.Set(NewString("error"), NewString(err.Error())) return result } if cmd.Process != nil { cmd.Process.Release() } result := NewOrderedMap() result.Set(NewString("success"), TRUE) result.Set(NewString("error"), NewString("")) return result case "darwin": cmd := exec.Command("open", path) if workingDir != "" { cmd.Dir = workingDir } cmd.Stdout = nil cmd.Stderr = nil err = cmd.Run() case "linux": cmd := exec.Command("xdg-open", path) if workingDir != "" { cmd.Dir = workingDir } cmd.Stdout = nil cmd.Stderr = nil err = cmd.Run() default: err = fmt.Errorf("unsupported platform: %s", runtime.GOOS) } result := NewOrderedMap() if err != nil { result.Set(NewString("success"), FALSE) result.Set(NewString("error"), NewString(err.Error())) } else { result.Set(NewString("success"), TRUE) result.Set(NewString("error"), NewString("")) } return result }, }
BuiltinSystemStart starts a program or opens a file/URL with the default application. This is similar to the "start" command on Windows or "open" on macOS. Usage: systemStart(path) or systemStart(path, workingDir) Returns a map with:
- "success": bool - whether the operation succeeded
- "error": string - error message if any
var Builtins = map[string]*Builtin{}/* 206 elements not displayed */
Builtins contains all built-in functions
var (
CHARS_EMPTY = &Chars{Value: []rune{}}
)
Pre-cached common chars values
var EMPTY_ARRAY = &Array{Elements: emptyElements}
Pre-cached empty array
var FileUploadBuiltins = map[string]*Builtin{ "getFileUploads": { Fn: func(args ...Object) Object { if len(args) != 1 { return newError("wrong number of arguments for getFileUploads. got=%d, want=1", len(args)) } req, ok := args[0].(*HttpReq) if !ok { return newError("argument to 'getFileUploads' must be HTTP_REQ, got %s", args[0].Type()) } if req.Value == nil { return newError("http request is nil") } if err := req.Value.ParseMultipartForm(32 << 20); err != nil { if strings.Contains(err.Error(), "multipart") { return NewMap(make(map[HashKey]MapPair)) } return newError("failed to parse multipart form: %v", err) } pairs := make(map[HashKey]MapPair) for key, fileHeaders := range req.Value.MultipartForm.File { k := NewString(key) uploads := make([]Object, len(fileHeaders)) for i, fh := range fileHeaders { uploads[i] = NewFileUpload(fh) } pairs[k.HashKey()] = MapPair{Key: k, Value: NewArray(uploads)} } return NewMap(pairs) }, }, "getFileUpload": { Fn: func(args ...Object) Object { if len(args) != 2 { return newError("wrong number of arguments for getFileUpload. got=%d, want=2", len(args)) } req, ok := args[0].(*HttpReq) if !ok { return newError("first argument to 'getFileUpload' must be HTTP_REQ, got %s", args[0].Type()) } fieldName, ok := args[1].(*String) if !ok { return newError("second argument to 'getFileUpload' must be STRING, got %s", args[1].Type()) } if req.Value == nil { return newError("http request is nil") } if err := req.Value.ParseMultipartForm(32 << 20); err != nil { return NULL } file, header, err := req.Value.FormFile(fieldName.Value) if err != nil { return NULL } file.Close() return NewFileUpload(header) }, }, "saveFile": { Fn: func(args ...Object) Object { if len(args) != 2 { return newError("wrong number of arguments for saveFile. got=%d, want=2", len(args)) } file, ok := args[0].(*FileUpload) if !ok { return newError("first argument to 'saveFile' must be FILE_UPLOAD, got %s", args[0].Type()) } path, ok := args[1].(*String) if !ok { return newError("second argument to 'saveFile' must be STRING, got %s", args[1].Type()) } savedPath, err := file.Save(path.Value) if err != nil { return NewFileUploadResult(false, err.Error(), "", file.Header.Filename, 0) } return NewFileUploadResult(true, "File saved successfully", savedPath, file.Header.Filename, file.Header.Size) }, }, "saveFileToDir": { Fn: func(args ...Object) Object { if len(args) < 2 || len(args) > 3 { return newError("wrong number of arguments for saveFileToDir. got=%d, want=2 or 3", len(args)) } file, ok := args[0].(*FileUpload) if !ok { return newError("first argument to 'saveFileToDir' must be FILE_UPLOAD, got %s", args[0].Type()) } dirPath, ok := args[1].(*String) if !ok { return newError("second argument to 'saveFileToDir' must be STRING, got %s", args[1].Type()) } autoRename := false if len(args) == 3 { ar, ok := args[2].(*Bool) if !ok { return newError("third argument to 'saveFileToDir' must be BOOL, got %s", args[2].Type()) } autoRename = ar.Value } savedPath, err := file.SaveToDir(dirPath.Value, autoRename) if err != nil { return NewFileUploadResult(false, err.Error(), "", file.Header.Filename, 0) } return NewFileUploadResult(true, "File saved successfully", savedPath, file.Header.Filename, file.Header.Size) }, }, "readFile": { Fn: func(args ...Object) Object { if len(args) != 1 { return newError("wrong number of arguments for readFile. got=%d, want=1", len(args)) } file, ok := args[0].(*FileUpload) if !ok { return newError("argument to 'readFile' must be FILE_UPLOAD, got %s", args[0].Type()) } content, err := file.ReadAsString() if err != nil { return newError("failed to read file: %v", err) } return NewString(content) }, }, "readFileBytes": { Fn: func(args ...Object) Object { if len(args) != 1 { return newError("wrong number of arguments for readFileBytes. got=%d, want=1", len(args)) } file, ok := args[0].(*FileUpload) if !ok { return newError("argument to 'readFileBytes' must be FILE_UPLOAD, got %s", args[0].Type()) } data, err := file.ReadAll() if err != nil { return newError("failed to read file: %v", err) } return NewBytesBufferFromBytes(data) }, }, "fileHashSHA256": { Fn: func(args ...Object) Object { if len(args) != 1 { return newError("wrong number of arguments for fileHashSHA256. got=%d, want=1", len(args)) } file, ok := args[0].(*FileUpload) if !ok { return newError("argument to 'fileHashSHA256' must be FILE_UPLOAD, got %s", args[0].Type()) } hash, err := file.HashSHA256() if err != nil { return newError("failed to calculate hash: %v", err) } return NewString(hash) }, }, "isFileUpload": { Fn: func(args ...Object) Object { if len(args) != 1 { return newError("wrong number of arguments for isFileUpload. got=%d, want=1", len(args)) } _, ok := args[0].(*FileUpload) return &Bool{Value: ok} }, }, "isFileUploadResult": { Fn: func(args ...Object) Object { if len(args) != 1 { return newError("wrong number of arguments for isFileUploadResult. got=%d, want=1", len(args)) } _, ok := args[0].(*FileUploadResult) return &Bool{Value: ok} }, }, "parseMultipartForm": { Fn: func(args ...Object) Object { if len(args) < 1 || len(args) > 2 { return newError("wrong number of arguments for parseMultipartForm. got=%d, want=1 or 2", len(args)) } req, ok := args[0].(*HttpReq) if !ok { return newError("first argument to 'parseMultipartForm' must be HTTP_REQ, got %s", args[0].Type()) } maxMemory := int64(32 << 20) if len(args) == 2 { m, ok := args[1].(*Int) if !ok { return newError("second argument to 'parseMultipartForm' must be INT, got %s", args[1].Type()) } maxMemory = m.Value } if req.Value == nil { return newError("http request is nil") } formValues, files, err := ParseMultipartForm(req.Value, maxMemory) if err != nil { return newError("failed to parse multipart form: %v", err) } resultPairs := make(map[HashKey]MapPair) valuesPairs := make(map[HashKey]MapPair) for key, vals := range formValues { k := NewString(key) var v Object if len(vals) == 1 { v = NewString(vals[0]) } else { elements := make([]Object, len(vals)) for i, val := range vals { elements[i] = NewString(val) } v = NewArray(elements) } valuesPairs[k.HashKey()] = MapPair{Key: k, Value: v} } resultPairs[NewString("values").HashKey()] = MapPair{ Key: NewString("values"), Value: NewMap(valuesPairs), } filesPairs := make(map[HashKey]MapPair) for key, uploads := range files { k := NewString(key) elements := make([]Object, len(uploads)) for i, upload := range uploads { elements[i] = upload } filesPairs[k.HashKey()] = MapPair{Key: k, Value: NewArray(elements)} } resultPairs[NewString("files").HashKey()] = MapPair{ Key: NewString("files"), Value: NewMap(filesPairs), } return NewMap(resultPairs) }, }, "safePath": { Fn: func(args ...Object) Object { if len(args) != 2 { return newError("wrong number of arguments for safePath. got=%d, want=2", len(args)) } baseDir, ok := args[0].(*String) if !ok { return newError("first argument to 'safePath' must be STRING, got %s", args[0].Type()) } filename, ok := args[1].(*String) if !ok { return newError("second argument to 'safePath' must be STRING, got %s", args[1].Type()) } safe, err := SafePath(baseDir.Value, filename.Value) if err != nil { return newError("unsafe path: %v", err) } return NewString(safe) }, }, "validateFile": { Fn: func(args ...Object) Object { if len(args) < 2 { return newError("wrong number of arguments for validateFile. got=%d, want at least 2", len(args)) } file, ok := args[0].(*FileUpload) if !ok { return newError("first argument to 'validateFile' must be FILE_UPLOAD, got %s", args[0].Type()) } maxSize, ok := args[1].(*Int) if !ok { return newError("second argument to 'validateFile' must be INT, got %s", args[1].Type()) } if maxSize.Value > 0 && file.Header.Size > maxSize.Value { return &Bool{Value: false} } if len(args) > 2 { ext := strings.ToLower(filepath.Ext(file.Header.Filename)) allowed := false for i := 2; i < len(args); i++ { allowedExt, ok := args[i].(*String) if !ok { continue } checkExt := strings.ToLower(allowedExt.Value) if !strings.HasPrefix(checkExt, ".") { checkExt = "." + checkExt } if checkExt == ext { allowed = true break } } if !allowed { return &Bool{Value: false} } } return &Bool{Value: true} }, }, "getFileExtension": { Fn: func(args ...Object) Object { if len(args) != 1 { return newError("wrong number of arguments for getFileExtension. got=%d, want=1", len(args)) } file, ok := args[0].(*FileUpload) if !ok { return newError("argument to 'getFileExtension' must be FILE_UPLOAD, got %s", args[0].Type()) } return NewString(filepath.Ext(file.Header.Filename)) }, }, "getFileName": { Fn: func(args ...Object) Object { if len(args) != 1 { return newError("wrong number of arguments for getFileName. got=%d, want=1", len(args)) } file, ok := args[0].(*FileUpload) if !ok { return newError("argument to 'getFileName' must be FILE_UPLOAD, got %s", args[0].Type()) } name := strings.TrimSuffix(file.Header.Filename, filepath.Ext(file.Header.Filename)) return NewString(name) }, }, "getFileSize": { Fn: func(args ...Object) Object { if len(args) != 1 { return newError("wrong number of arguments for getFileSize. got=%d, want=1", len(args)) } file, ok := args[0].(*FileUpload) if !ok { return newError("argument to 'getFileSize' must be FILE_UPLOAD, got %s", args[0].Type()) } return NewInt(file.Header.Size) }, }, "getFileContentType": { Fn: func(args ...Object) Object { if len(args) != 1 { return newError("wrong number of arguments for getFileContentType. got=%d, want=1", len(args)) } file, ok := args[0].(*FileUpload) if !ok { return newError("argument to 'getFileContentType' must be FILE_UPLOAD, got %s", args[0].Type()) } return NewString(file.Header.Header.Get("Content-Type")) }, }, "openFileUpload": { Fn: func(args ...Object) Object { if len(args) != 1 { return newError("wrong number of arguments for openFileUpload. got=%d, want=1", len(args)) } file, ok := args[0].(*FileUpload) if !ok { return newError("argument to 'openFileUpload' must be FILE_UPLOAD, got %s", args[0].Type()) } f, err := file.Header.Open() if err != nil { return newError("failed to open file: %v", err) } defer f.Close() data, err := io.ReadAll(f) if err != nil { return newError("failed to read file: %v", err) } return NewBytesBufferFromBytes(data) }, }, "saveUploadedFile": { Fn: func(args ...Object) Object { if len(args) < 3 || len(args) > 4 { return newError("wrong number of arguments for saveUploadedFile. got=%d, want=3 or 4", len(args)) } req, ok := args[0].(*HttpReq) if !ok { return newError("first argument to 'saveUploadedFile' must be HTTP_REQ, got %s", args[0].Type()) } fieldName, ok := args[1].(*String) if !ok { return newError("second argument to 'saveUploadedFile' must be STRING, got %s", args[1].Type()) } dirPath, ok := args[2].(*String) if !ok { return newError("third argument to 'saveUploadedFile' must be STRING, got %s", args[2].Type()) } if req.Value == nil { return NewFileUploadResult(false, "http request is nil", "", "", 0) } maxSize := int64(10 * 1024 * 1024) autoRename := true var allowedExtensions []string if len(args) == 4 { opts, ok := args[3].(*Map) if !ok { return newError("fourth argument to 'saveUploadedFile' must be MAP, got %s", args[3].Type()) } for _, pair := range opts.Pairs { keyStr, ok := pair.Key.(*String) if !ok { continue } switch keyStr.Value { case "maxSize": if v, ok := pair.Value.(*Int); ok { maxSize = v.Value } case "autoRename": if v, ok := pair.Value.(*Bool); ok { autoRename = v.Value } case "allowedExtensions": if arr, ok := pair.Value.(*Array); ok { for _, elem := range arr.Elements { if s, ok := elem.(*String); ok { allowedExtensions = append(allowedExtensions, s.Value) } } } } } } if err := req.Value.ParseMultipartForm(maxSize); err != nil { return NewFileUploadResult(false, fmt.Sprintf("failed to parse form: %v", err), "", "", 0) } file, header, err := req.Value.FormFile(fieldName.Value) if err != nil { return NewFileUploadResult(false, fmt.Sprintf("file not found: %v", err), "", "", 0) } file.Close() upload := NewFileUpload(header) if header.Size > maxSize { return NewFileUploadResult(false, fmt.Sprintf("file size %d exceeds maximum %d", header.Size, maxSize), "", header.Filename, header.Size) } if len(allowedExtensions) > 0 { ext := strings.ToLower(filepath.Ext(header.Filename)) allowed := false for _, ae := range allowedExtensions { checkExt := strings.ToLower(ae) if !strings.HasPrefix(checkExt, ".") { checkExt = "." + checkExt } if checkExt == ext { allowed = true break } } if !allowed { return NewFileUploadResult(false, fmt.Sprintf("file extension %s is not allowed", ext), "", header.Filename, header.Size) } } savedPath, err := upload.SaveToDir(dirPath.Value, autoRename) if err != nil { return NewFileUploadResult(false, err.Error(), "", header.Filename, header.Size) } return NewFileUploadResult(true, "File saved successfully", savedPath, header.Filename, header.Size) }, }, }
FileUploadBuiltins contains all file upload related built-in functions. These are only available in server mode.
var HttpBuiltins = map[string]*Builtin{ "writeResp": { Fn: func(args ...Object) Object { if len(args) != 2 { return newError("wrong number of arguments for writeResp. got=%d, want=2", len(args)) } resp, ok := args[0].(*HttpResp) if !ok { return newError("first argument to 'writeResp' must be HTTP_RESP, got %s", args[0].Type()) } var content string switch c := args[1].(type) { case *String: content = c.Value default: content = c.Inspect() } if resp.Value == nil { return newError("http response is nil") } _, err := resp.Value.Write([]byte(content)) if err != nil { return newError("write response failed: %v", err) } resp.SetWritten() return NULL }, }, "setRespHeader": { Fn: func(args ...Object) Object { if len(args) != 3 { return newError("wrong number of arguments for setRespHeader. got=%d, want=3", len(args)) } resp, ok := args[0].(*HttpResp) if !ok { return newError("first argument to 'setRespHeader' must be HTTP_RESP, got %s", args[0].Type()) } key, ok := args[1].(*String) if !ok { return newError("second argument to 'setRespHeader' must be STRING, got %s", args[1].Type()) } value, ok := args[2].(*String) if !ok { return newError("third argument to 'setRespHeader' must be STRING, got %s", args[2].Type()) } if resp.Value == nil { return newError("http response is nil") } resp.Value.Header().Set(key.Value, value.Value) return NULL }, }, "addRespHeader": { Fn: func(args ...Object) Object { if len(args) != 3 { return newError("wrong number of arguments for addRespHeader. got=%d, want=3", len(args)) } resp, ok := args[0].(*HttpResp) if !ok { return newError("first argument to 'addRespHeader' must be HTTP_RESP, got %s", args[0].Type()) } key, ok := args[1].(*String) if !ok { return newError("second argument to 'addRespHeader' must be STRING, got %s", args[1].Type()) } value, ok := args[2].(*String) if !ok { return newError("third argument to 'addRespHeader' must be STRING, got %s", args[2].Type()) } if resp.Value == nil { return newError("http response is nil") } resp.Value.Header().Add(key.Value, value.Value) return NULL }, }, "getReqHeader": { Fn: func(args ...Object) Object { if len(args) != 2 { return newError("wrong number of arguments for getReqHeader. got=%d, want=2", len(args)) } req, ok := args[0].(*HttpReq) if !ok { return newError("first argument to 'getReqHeader' must be HTTP_REQ, got %s", args[0].Type()) } key, ok := args[1].(*String) if !ok { return newError("second argument to 'getReqHeader' must be STRING, got %s", args[1].Type()) } if req.Value == nil { return newError("http request is nil") } value := req.Value.Header.Get(key.Value) return NewString(value) }, }, "getReqHeaders": { Fn: func(args ...Object) Object { if len(args) != 1 { return newError("wrong number of arguments for getReqHeaders. got=%d, want=1", len(args)) } req, ok := args[0].(*HttpReq) if !ok { return newError("argument to 'getReqHeaders' must be HTTP_REQ, got %s", args[0].Type()) } if req.Value == nil { return newError("http request is nil") } return req.getHeaders() }, }, "setCookie": { Fn: func(args ...Object) Object { if len(args) < 3 || len(args) > 4 { return newError("wrong number of arguments for setCookie. got=%d, want=3 or 4", len(args)) } resp, ok := args[0].(*HttpResp) if !ok { return newError("first argument to 'setCookie' must be HTTP_RESP, got %s", args[0].Type()) } name, ok := args[1].(*String) if !ok { return newError("second argument to 'setCookie' must be STRING, got %s", args[1].Type()) } value, ok := args[2].(*String) if !ok { return newError("third argument to 'setCookie' must be STRING, got %s", args[2].Type()) } if resp.Value == nil { return newError("http response is nil") } cookie := &http.Cookie{ Name: name.Value, Value: value.Value, } if len(args) == 4 { opts, ok := args[3].(*Map) if !ok { return newError("fourth argument to 'setCookie' must be MAP, got %s", args[3].Type()) } for _, pair := range opts.Pairs { keyStr, ok := pair.Key.(*String) if !ok { continue } switch keyStr.Value { case "path": if v, ok := pair.Value.(*String); ok { cookie.Path = v.Value } case "domain": if v, ok := pair.Value.(*String); ok { cookie.Domain = v.Value } case "maxAge": if v, ok := pair.Value.(*Int); ok { cookie.MaxAge = int(v.Value) } case "secure": if v, ok := pair.Value.(*Bool); ok { cookie.Secure = v.Value } case "httpOnly": if v, ok := pair.Value.(*Bool); ok { cookie.HttpOnly = v.Value } case "sameSite": if v, ok := pair.Value.(*Int); ok { cookie.SameSite = http.SameSite(v.Value) } case "expires": if v, ok := pair.Value.(*String); ok { t, err := time.Parse(time.RFC3339, v.Value) if err == nil { cookie.Expires = t } } } } } http.SetCookie(resp.Value, cookie) return NULL }, }, "getCookie": { Fn: func(args ...Object) Object { if len(args) != 2 { return newError("wrong number of arguments for getCookie. got=%d, want=2", len(args)) } req, ok := args[0].(*HttpReq) if !ok { return newError("first argument to 'getCookie' must be HTTP_REQ, got %s", args[0].Type()) } name, ok := args[1].(*String) if !ok { return newError("second argument to 'getCookie' must be STRING, got %s", args[1].Type()) } if req.Value == nil { return newError("http request is nil") } cookie, err := req.Value.Cookie(name.Value) if err != nil { return NULL } return NewString(cookie.Value) }, }, "getCookies": { Fn: func(args ...Object) Object { if len(args) != 1 { return newError("wrong number of arguments for getCookies. got=%d, want=1", len(args)) } req, ok := args[0].(*HttpReq) if !ok { return newError("argument to 'getCookies' must be HTTP_REQ, got %s", args[0].Type()) } if req.Value == nil { return newError("http request is nil") } pairs := make(map[HashKey]MapPair) for _, cookie := range req.Value.Cookies() { k := NewString(cookie.Name) pairs[k.HashKey()] = MapPair{Key: k, Value: NewString(cookie.Value)} } return NewMap(pairs) }, }, "parseForm": { Fn: func(args ...Object) Object { if len(args) != 1 { return newError("wrong number of arguments for parseForm. got=%d, want=1", len(args)) } req, ok := args[0].(*HttpReq) if !ok { return newError("argument to 'parseForm' must be HTTP_REQ, got %s", args[0].Type()) } if req.Value == nil { return newError("http request is nil") } if err := req.Value.ParseForm(); err != nil { return newError("parse form failed: %v", err) } pairs := make(map[HashKey]MapPair) for key, values := range req.Value.URL.Query() { k := NewString(key) var v Object if len(values) == 1 { v = NewString(values[0]) } else { elements := make([]Object, len(values)) for i, val := range values { elements[i] = NewString(val) } v = NewArray(elements) } pairs[k.HashKey()] = MapPair{Key: k, Value: v} } for key, values := range req.Value.PostForm { k := NewString(key) if existing, ok := pairs[k.HashKey()]; ok { if arr, ok := existing.Value.(*Array); ok { elements := arr.Elements for _, val := range values { elements = append(elements, NewString(val)) } pairs[k.HashKey()] = MapPair{Key: k, Value: NewArray(elements)} } else { elements := []Object{existing.Value} for _, val := range values { elements = append(elements, NewString(val)) } pairs[k.HashKey()] = MapPair{Key: k, Value: NewArray(elements)} } } else { var v Object if len(values) == 1 { v = NewString(values[0]) } else { elements := make([]Object, len(values)) for i, val := range values { elements[i] = NewString(val) } v = NewArray(elements) } pairs[k.HashKey()] = MapPair{Key: k, Value: v} } } return NewMap(pairs) }, }, "status": { Fn: func(args ...Object) Object { if len(args) != 2 { return newError("wrong number of arguments for status. got=%d, want=2", len(args)) } resp, ok := args[0].(*HttpResp) if !ok { return newError("first argument to 'status' must be HTTP_RESP, got %s", args[0].Type()) } code, ok := args[1].(*Int) if !ok { return newError("second argument to 'status' must be INT, got %s", args[1].Type()) } if resp.Value == nil { return newError("http response is nil") } resp.Value.WriteHeader(int(code.Value)) return NULL }, }, "redirect": { Fn: func(args ...Object) Object { if len(args) < 2 || len(args) > 3 { return newError("wrong number of arguments for redirect. got=%d, want=2 or 3", len(args)) } resp, ok := args[0].(*HttpResp) if !ok { return newError("first argument to 'redirect' must be HTTP_RESP, got %s", args[0].Type()) } url, ok := args[1].(*String) if !ok { return newError("second argument to 'redirect' must be STRING, got %s", args[1].Type()) } code := 302 if len(args) == 3 { c, ok := args[2].(*Int) if !ok { return newError("third argument to 'redirect' must be INT, got %s", args[2].Type()) } code = int(c.Value) } if resp.Value == nil { return newError("http response is nil") } http.Redirect(resp.Value, &http.Request{}, url.Value, code) resp.SetWritten() return NULL }, }, "serveFile": { Fn: func(args ...Object) Object { if len(args) != 3 { return newError("wrong number of arguments for serveFile. got=%d, want=3", len(args)) } resp, ok := args[0].(*HttpResp) if !ok { return newError("first argument to 'serveFile' must be HTTP_RESP, got %s", args[0].Type()) } req, ok := args[1].(*HttpReq) if !ok { return newError("second argument to 'serveFile' must be HTTP_REQ, got %s", args[1].Type()) } path, ok := args[2].(*String) if !ok { return newError("third argument to 'serveFile' must be STRING, got %s", args[2].Type()) } if resp.Value == nil || req.Value == nil { return newError("http response or request is nil") } http.ServeFile(resp.Value, req.Value, path.Value) resp.SetWritten() return NULL }, }, "setContentType": { Fn: func(args ...Object) Object { if len(args) != 2 { return newError("wrong number of arguments for setContentType. got=%d, want=2", len(args)) } resp, ok := args[0].(*HttpResp) if !ok { return newError("first argument to 'setContentType' must be HTTP_RESP, got %s", args[0].Type()) } mimeType, ok := args[1].(*String) if !ok { return newError("second argument to 'setContentType' must be STRING, got %s", args[1].Type()) } if resp.Value == nil { return newError("http response is nil") } resp.Value.Header().Set("Content-Type", mimeType.Value) return NULL }, }, "queryParam": { Fn: func(args ...Object) Object { if len(args) != 2 { return newError("wrong number of arguments for queryParam. got=%d, want=2", len(args)) } req, ok := args[0].(*HttpReq) if !ok { return newError("first argument to 'queryParam' must be HTTP_REQ, got %s", args[0].Type()) } name, ok := args[1].(*String) if !ok { return newError("second argument to 'queryParam' must be STRING, got %s", args[1].Type()) } if req.Value == nil { return newError("http request is nil") } value := req.Value.URL.Query().Get(name.Value) return NewString(value) }, }, "queryParams": { Fn: func(args ...Object) Object { if len(args) != 1 { return newError("wrong number of arguments for queryParams. got=%d, want=1", len(args)) } req, ok := args[0].(*HttpReq) if !ok { return newError("argument to 'queryParams' must be HTTP_REQ, got %s", args[0].Type()) } if req.Value == nil { return newError("http request is nil") } pairs := make(map[HashKey]MapPair) for key, values := range req.Value.URL.Query() { k := NewString(key) var v Object if len(values) == 1 { v = NewString(values[0]) } else { elements := make([]Object, len(values)) for i, val := range values { elements[i] = NewString(val) } v = NewArray(elements) } pairs[k.HashKey()] = MapPair{Key: k, Value: v} } return NewMap(pairs) }, }, "formValue": { Fn: func(args ...Object) Object { if len(args) != 2 { return newError("wrong number of arguments for formValue. got=%d, want=2", len(args)) } req, ok := args[0].(*HttpReq) if !ok { return newError("first argument to 'formValue' must be HTTP_REQ, got %s", args[0].Type()) } name, ok := args[1].(*String) if !ok { return newError("second argument to 'formValue' must be STRING, got %s", args[1].Type()) } if req.Value == nil { return newError("http request is nil") } value := req.Value.FormValue(name.Value) return NewString(value) }, }, }
HttpBuiltins contains all HTTP-related built-in functions. These are only available in server mode.
var NULL = &Null{}
NULL is the singleton null value
var TypeMethods = map[ObjectType]map[string]*Builtin{
IntType: intMethods,
FloatType: floatMethods,
BigIntType: bigIntMethods,
BigFloatType: bigFloatMethods,
StringType: stringMethods,
CharsType: charsMethods,
ArrayType: arrayMethods,
MapType: mapMethods,
BoolType: boolMethods,
NullType: nullMethods,
StringBuilderType: stringBuilderMethods,
BytesType: bytesMethods,
BytesBufferType: bytesBufferMethods,
WebSocketType: webSocketMethods,
MutexType: mutexMethods,
RWMutexType: rwMutexMethods,
WaitGroupType: waitGroupMethods,
AtomicIntType: atomicIntMethods,
TubeType: tubeMethods,
OnceType: onceMethods,
CondType: condMethods,
ContextType: contextMethods,
FileUploadType: fileUploadMethods,
FileUploadResultType: fileUploadResultMethods,
FileType: fileMethods,
FileInfoType: fileInfoMethods,
ReaderType: readerMethods,
WriterType: writerMethods,
ScannerType: scannerMethods,
OrderedMapType: orderedMapMethods,
QueueType: queueMethods,
SetType: setMethods,
XLSXType: xlsxMethods,
PPTXDocumentType: pptxDocumentMethods,
PPTXSlideType: pptxSlideMethods,
PPTXTextFrameType: pptxTextFrameMethods,
PPTXTextRunType: pptxTextRunMethods,
PPTXShapeType: pptxShapeMethods,
PPTXTableType: pptxTableMethods,
PPTXChartType: pptxChartMethods,
PPTXImageType: pptxImageMethods,
XMLDocumentType: xmlDocumentMethods,
XMLNodeType: xmlNodeMethods,
SocketAddrType: socketAddrMethods,
TcpServerType: tcpServerMethods,
TcpClientType: tcpClientMethods,
UdpSocketType: udpSocketMethods,
LineEditorType: lineEditorMethods,
SSHClientType: sshClientMethods,
FtpClientType: ftpClientMethods,
FtpServerType: ftpServerMethods,
SftpClientType: sftpClientMethods,
SftpServerType: sftpServerMethods,
HTMLDocumentType: htmlDocumentMethods,
HTMLElementType: htmlElementMethods,
TomlDocumentType: tomlDocumentMethods,
TimeType: timeMethods,
}
TypeMethods maps ObjectType -> methodName -> *Builtin
Functions ¶
func ClearInternCache ¶ added in v0.4.23
func ClearInternCache()
ClearInternCache clears the string intern cache Use with caution - this will cause all interned strings to be re-allocated
func ColToIndex ¶ added in v0.5.2
ColToIndex converts column letter to index (A=1).
func ConvertToPinyin ¶ added in v0.5.13
ConvertToPinyin converts Chinese characters to Pinyin withTone: if true, returns pinyin with tone marks (deprecated, use ConvertToPinyinEx) initialsOnly: if true, returns only the first letter (initial)
func ConvertToPinyinEx ¶ added in v0.5.13
ConvertToPinyinEx converts Chinese characters to Pinyin with extended options toneStyle: how to represent tones (ToneNone, ToneMark, ToneNumber) initialsOnly: if true, returns only the first letter (initial)
func ConvertToPinyinWithSeparator ¶ added in v0.5.13
func ConvertToPinyinWithSeparator(text string, withTone bool, initialsOnly bool, separator string) string
ConvertToPinyinWithSeparator converts Chinese characters to Pinyin with a separator
func ConvertToPinyinWithSeparatorEx ¶ added in v0.5.13
func ConvertToPinyinWithSeparatorEx(text string, toneStyle ToneStyle, initialsOnly bool, separator string) string
ConvertToPinyinWithSeparatorEx converts Chinese characters to Pinyin with extended options
func DecodeQRCode ¶ added in v0.5.13
DecodeQRCode decodes a QR code from an image This is a simplified decoder that works with basic QR codes
func DetectYAMLValueType ¶ added in v0.5.10
DetectYAMLValueType detects the type of a YAML value string
func EncodeToHTML ¶ added in v0.5.10
EncodeToHTML converts an Object to HTML string.
func EncodeToToml ¶ added in v0.5.13
func EncodeToToml(v interface{}) string
EncodeToToml encodes any value to TOML
func EncodeToXML ¶ added in v0.5.4
EncodeToXML converts an Object to XML string.
func EncodeToml ¶ added in v0.5.13
EncodeToml encodes a TomlValue to a TOML string
func ErrIndexOutOfRange ¶ added in v0.5.6
ErrIndexOutOfRange creates an error for an out of range index
func ErrKeyNotFound ¶ added in v0.5.6
ErrKeyNotFound creates an error for a missing key
func EscapeHTML ¶ added in v0.5.10
EscapeHTML escapes special characters for HTML content.
func EscapeHTMLAttr ¶ added in v0.5.10
EscapeHTMLAttr escapes special characters for HTML attributes.
func EscapeXMLAttr ¶ added in v0.5.4
EscapeXMLAttr escapes special characters for XML attributes.
func EscapeXMLText ¶ added in v0.5.4
EscapeXMLText escapes special characters for XML text.
func ExtractYAMLAnchors ¶ added in v0.5.10
ExtractYAMLAnchors extracts all anchor definitions from a YAML document
func FormatBigFloat ¶ added in v0.4.25
FormatBigFloat formats a BigFloat value for display with the 'm' suffix
func FormatBigInt ¶ added in v0.4.25
FormatBigInt formats a BigInt value for display with the 'n' suffix
func GenJwtToken ¶ added in v0.5.13
func GenJwtToken(payload *Map, secret []byte, withType, base64Secret bool, expireSeconds int64) (string, error)
GenJwtToken generates a JWT token from payload and secret. Exported for use by crypto module.
func GenerateQRCode ¶ added in v0.5.13
func GenerateQRCode(data string, level QRCodeLevel, size int) ([]byte, error)
GenerateQRCode generates a QR code from the given data
func GetPinyinInitials ¶ added in v0.5.13
GetPinyinInitials returns the initials (first letters) of pinyin
func GetPinyinWithTone ¶ added in v0.5.13
GetPinyinWithTone returns pinyin with tone marks
func GetPinyinWithToneNumber ¶ added in v0.5.13
GetPinyinWithToneNumber returns pinyin with tone numbers (e.g., zhong1guo2)
func IndexToCol ¶ added in v0.5.2
IndexToCol converts index to column letter.
func IsCachedInt ¶ added in v0.4.23
IsCachedInt returns true if the given value is within the cached range
func IsValidKey ¶ added in v0.5.13
IsValidKey checks if a string is a valid bare key
func IsYAMLSet ¶ added in v0.5.10
IsYAMLSet checks if a map represents a YAML set (all values are null)
func JSONToYAML ¶ added in v0.5.10
JSONToYAML converts a JSON string to YAML
func JoinYAMLDocuments ¶ added in v0.5.10
JoinYAMLDocuments joins multiple YAML documents into a multi-document YAML string
func KanaToRomaji ¶ added in v0.5.13
KanaToRomaji converts Hiragana/Katakana to Romaji
func KanjiToKana ¶ added in v0.5.13
KanjiToKana converts Kanji to Kana (Hiragana)
func KanjiToRomaji ¶ added in v0.5.13
KanjiToRomaji converts Kanji directly to Romaji
func LoadImageFromReader ¶ added in v0.5.13
LoadImageFromReader loads an image from an io.Reader. This is exported for use by the image stdlib module.
func NewBytesReader ¶ added in v0.4.25
NewBytesReader creates an io.Reader from a byte slice. This is useful for creating a Reader from byte array data.
func NewStringReader ¶ added in v0.4.25
NewStringReader creates an io.Reader from a string. This is useful for creating a Reader from a string value.
func NormalizeYAML ¶ added in v0.5.10
NormalizeYAML normalizes YAML content by parsing and re-serializing
func ObjectToGoValue ¶ added in v0.4.25
ObjectToGoValue converts an Xxlang Object to a Go value suitable for JSON marshaling. Returns nil for null, and returns an error for types that cannot be serialized.
func ObjectToJSON ¶ added in v0.4.25
func ObjectToJSON(obj Object, opts ObjectToJSONOptions) ([]byte, error)
ObjectToJSON converts an Object to JSON bytes with the given options. This is the primary function for JSON serialization in Xxlang.
func ParseCellRef ¶ added in v0.5.2
ParseCellRef parses a cell reference.
func ParseCronRange ¶ added in v0.5.13
ParseCronRange parses a cron range expression (e.g., "1-5")
func ParseCronStep ¶ added in v0.5.13
ParseCronStep parses a cron step expression (e.g., "*/5" or "0-30/5")
func ParseCronValue ¶ added in v0.5.13
ParseCronValue parses a single cron value
func ParseHexColor ¶ added in v0.5.13
ParseHexColor parses a hex color string. This is exported for use by the image stdlib module.
func ParseJwtToken ¶ added in v0.5.13
func ParseJwtToken(tokenStr string, secret []byte, base64Secret, noValidate bool) (map[string]interface{}, error)
ParseJwtToken parses and validates a JWT token with secret. Exported for use by crypto module.
func ParseMultipartForm ¶ added in v0.4.25
func ParseMultipartForm(req *http.Request, maxMemory int64) (map[string][]string, map[string][]*FileUpload, error)
ParseMultipartForm parses a multipart form from an HTTP request. It returns a map of form values and a map of file uploads.
func PutBufferedFloat ¶ added in v0.4.23
func PutBufferedFloat(obj *Float)
PutBufferedFloat returns a temporary Float to the global buffer
func PutBufferedInt ¶ added in v0.4.23
func PutBufferedInt(obj *Int)
PutBufferedInt returns a temporary Int to the global buffer
func PutBufferedString ¶ added in v0.4.23
func PutBufferedString(obj *String)
PutBufferedString returns a temporary String to the global buffer
func RegisterFileUploadBuiltins ¶ added in v0.4.25
func RegisterFileUploadBuiltins()
RegisterFileUploadBuiltins registers file upload built-in functions into the main Builtins map.
func RegisterHttpBuiltins ¶ added in v0.4.25
func RegisterHttpBuiltins()
RegisterHttpBuiltins registers HTTP built-in functions into the main Builtins map.
func ReleaseArray ¶ added in v0.4.23
func ReleaseArray(obj *Array)
ReleaseArray returns an Array object to the pool
func ReleaseArraySlice ¶ added in v0.4.23
func ReleaseArraySlice(objs []*Array)
ReleaseArraySlice returns multiple Array objects to the pool
func ReleaseFloat ¶ added in v0.4.23
func ReleaseFloat(obj *Float)
ReleaseFloat returns a Float object to the pool if it's not a cached value This should be called when the object is no longer needed
func ReleaseFloatSlice ¶ added in v0.4.23
func ReleaseFloatSlice(objs []*Float)
ReleaseFloatSlice returns multiple Float objects to the pool This is more efficient than calling ReleaseFloat multiple times
func ReleaseInt ¶ added in v0.4.23
func ReleaseInt(obj *Int)
ReleaseInt returns an Int object to the pool if it's outside the cache range This should be called when the object is no longer needed
func ReleaseIntSlice ¶ added in v0.4.23
func ReleaseIntSlice(objs []*Int)
ReleaseIntSlice returns multiple Int objects to the pool This is more efficient than calling ReleaseInt multiple times
func ReleaseMap ¶ added in v0.4.23
func ReleaseMap(obj *Map)
ReleaseMap returns a Map object to the pool
func ReleaseMapSlice ¶ added in v0.4.23
func ReleaseMapSlice(objs []*Map)
ReleaseMapSlice returns multiple Map objects to the pool
func ReleaseOrderedMap ¶ added in v0.5.6
func ReleaseOrderedMap(om *OrderedMap)
ReleaseOrderedMap returns an OrderedMap to the pool
func ReleaseString ¶ added in v0.4.23
func ReleaseString(obj *String)
ReleaseString returns a String object to the pool if it's not a cached value This should be called when the object is no longer needed
func ReleaseStringSlice ¶ added in v0.4.23
func ReleaseStringSlice(objs []*String)
ReleaseStringSlice returns multiple String objects to the pool This is more efficient than calling ReleaseString multiple times
func ResetArrayPoolStats ¶ added in v0.4.23
func ResetArrayPoolStats()
ResetArrayPoolStats resets the pool statistics counters
func ResetFloatPoolStats ¶ added in v0.4.23
func ResetFloatPoolStats()
ResetFloatPoolStats resets the pool statistics counters
func ResetGlobalReader ¶ added in v0.4.25
func ResetGlobalReader()
ResetGlobalReader resets the global reader for stdin. This is useful for testing or when stdin needs to be reinitialized.
func ResetIntPoolStats ¶ added in v0.4.23
func ResetIntPoolStats()
ResetIntPoolStats resets the pool statistics counters
func ResetMapPoolStats ¶ added in v0.4.23
func ResetMapPoolStats()
ResetMapPoolStats resets the pool statistics counters
func ResetStringPoolStats ¶ added in v0.4.23
func ResetStringPoolStats()
ResetStringPoolStats resets the pool statistics counters
func SafePath ¶ added in v0.4.25
SafePath validates and returns a safe file path. It prevents directory traversal attacks by checking for ".." and ensuring the path is within the allowed directory.
func SanitizeHTML ¶ added in v0.5.10
SanitizeHTML removes potentially dangerous HTML content.
func ScanRow ¶ added in v0.4.36
ScanRow scans a single row into a map. This is a helper function used by the db module.
func SerializeYAML ¶ added in v0.5.10
SerializeYAML converts an Xxlang Object to a YAML string.
func SetCallUserFuncImpl ¶ added in v0.4.25
func SetCallUserFuncImpl(fn func(fnObj Object, args ...Object) (Object, error)) func(Object, ...Object) (Object, error)
SetCallUserFuncImpl registers the callback for calling user functions and returns the previous value
func SetDelegateImpl ¶ added in v0.4.25
SetDelegateImpl registers the delegate implementation and returns the previous value
func SetLoadPluginImpl ¶ added in v0.4.19
SetLoadPluginImpl registers the loadPlugin implementation and returns the previous value
func SetRunCodeImpl ¶ added in v0.4.19
func SetRunCodeImpl(fn func(code string, args *Map) (Object, error)) func(code string, args *Map) (Object, error)
SetRunCodeImpl registers the runCode implementation and returns the previous value
func SplitYAMLDocuments ¶ added in v0.5.10
SplitYAMLDocuments splits a YAML string into individual documents
func TestUdpSocket_Bind ¶ added in v0.6.0
func TestUdpSocket_BindAlreadyBound ¶ added in v0.6.0
func TestUdpSocket_BindClosed ¶ added in v0.6.0
func TestUdpSocket_Close ¶ added in v0.6.0
func TestUdpSocket_HashKey ¶ added in v0.6.0
func TestUdpSocket_Inspect ¶ added in v0.6.0
func TestUdpSocket_New ¶ added in v0.6.0
func TestUdpSocket_ReceiveFromBytesClosed ¶ added in v0.6.0
func TestUdpSocket_ReceiveFromBytesUnbound ¶ added in v0.6.0
func TestUdpSocket_ReceiveFromClosed ¶ added in v0.6.0
func TestUdpSocket_ReceiveFromUnbound ¶ added in v0.6.0
func TestUdpSocket_SendToBytesClosed ¶ added in v0.6.0
func TestUdpSocket_SendToClosed ¶ added in v0.6.0
func TestUdpSocket_SetTimeout ¶ added in v0.6.0
func TestUdpSocket_ToBool ¶ added in v0.6.0
func TestUdpSocket_Type ¶ added in v0.6.0
func TestUdpSocket_TypeTag ¶ added in v0.6.0
func UnescapeHTML ¶ added in v0.5.10
UnescapeHTML unescapes HTML entities.
func ValidateToml ¶ added in v0.5.13
ValidateToml validates a TOML string
func ValidateYAML ¶ added in v0.5.10
ValidateYAML validates a YAML string and returns detailed error information
func WarmArrayPool ¶ added in v0.4.23
func WarmArrayPool(count int)
WarmArrayPool pre-allocates Array objects into the pool
func WarmFloatPool ¶ added in v0.4.23
func WarmFloatPool(count int)
WarmFloatPool pre-allocates a number of Float objects into the pool This can improve performance by reducing allocations during hot paths
func WarmIntPool ¶ added in v0.4.23
func WarmIntPool(count int)
WarmIntPool pre-allocates a number of Int objects into the pool This can improve performance by reducing allocations during hot paths
func WarmMapPool ¶ added in v0.4.23
func WarmMapPool(count int)
WarmMapPool pre-allocates Map objects into the pool
func WarmStringPool ¶ added in v0.4.23
func WarmStringPool(count int)
WarmStringPool pre-allocates a number of String objects into the pool This can improve performance by reducing allocations during hot paths
func YAMLToJSON ¶ added in v0.5.10
YAMLToJSON converts a YAML string to JSON
Types ¶
type Array ¶
type Array struct {
Elements []Object
LastPopped Object // Used by pop() to return the popped value
}
Array represents an array value
func NewArrayWithCapacity ¶ added in v0.4.23
NewArrayWithCapacity creates a new Array with pre-allocated capacity
type ArrayPoolStats ¶ added in v0.4.23
ArrayPoolStats tracks statistics about array pool usage
func GetArrayPoolStats ¶ added in v0.4.23
func GetArrayPoolStats() ArrayPoolStats
GetArrayPoolStats returns current statistics about array pool usage
type AtomicInt ¶ added in v0.4.25
type AtomicInt struct {
// contains filtered or unexported fields
}
AtomicInt provides atomic operations on an integer
func NewAtomicInt ¶ added in v0.4.25
NewAtomicInt creates a new AtomicInt with the given initial value
func (*AtomicInt) Add ¶ added in v0.4.25
Add atomically adds delta to the value and returns the new value
func (*AtomicInt) CompareAndSwap ¶ added in v0.4.25
CompareAndSwap atomically compares and swaps Returns true if the swap was successful
func (*AtomicInt) Type ¶ added in v0.4.25
func (a *AtomicInt) Type() ObjectType
Object interface implementation
type BigFloat ¶ added in v0.4.25
BigFloat represents an arbitrary-precision floating-point value It wraps Go's math/big.Float for unlimited precision floating-point arithmetic
func NewBigFloat ¶ added in v0.4.25
NewBigFloat creates a new BigFloat from a big.Float
func NewBigFloatFromBigInt ¶ added in v0.4.25
NewBigFloatFromBigInt creates a new BigFloat from a BigInt object
func NewBigFloatFromFloat64 ¶ added in v0.4.25
NewBigFloatFromFloat64 creates a new BigFloat from a float64
func NewBigFloatFromInt ¶ added in v0.4.25
NewBigFloatFromInt creates a new BigFloat from an Int object
func NewBigFloatFromInt64 ¶ added in v0.4.25
NewBigFloatFromInt64 creates a new BigFloat from an int64
func NewBigFloatFromString ¶ added in v0.4.25
NewBigFloatFromString creates a new BigFloat from a string representation
func (*BigFloat) AddFloat64 ¶ added in v0.4.25
AddFloat64 returns a new BigFloat that is the sum of b and a float64
func (*BigFloat) Ceil ¶ added in v0.4.25
Ceil returns the least integer value greater than or equal to b
func (*BigFloat) Cmp ¶ added in v0.4.25
Cmp compares two BigFloat values Returns -1 if b < other, 0 if b == other, 1 if b > other
func (*BigFloat) Div ¶ added in v0.4.25
Div returns a new BigFloat that is b divided by other Returns nil if other is zero
func (*BigFloat) DivFloat64 ¶ added in v0.4.25
DivFloat64 returns a new BigFloat that is b divided by a float64 Returns nil if f is zero
func (*BigFloat) Floor ¶ added in v0.4.25
Floor returns the greatest integer value less than or equal to b
func (*BigFloat) Inspect ¶ added in v0.4.25
Inspect returns the string representation (without the 'm' suffix)
func (*BigFloat) IsNegative ¶ added in v0.4.25
IsNegative returns true if the BigFloat is negative
func (*BigFloat) IsPositive ¶ added in v0.4.25
IsPositive returns true if the BigFloat is positive
func (*BigFloat) MulFloat64 ¶ added in v0.4.25
MulFloat64 returns a new BigFloat that is b multiplied by a float64
func (*BigFloat) Precision ¶ added in v0.4.25
Precision returns the precision of the BigFloat in bits
func (*BigFloat) SetPrecision ¶ added in v0.4.25
SetPrecision returns a new BigFloat with the specified precision
func (*BigFloat) Sign ¶ added in v0.4.25
Sign returns the sign of the BigFloat Returns -1 for negative, 0 for zero, 1 for positive
func (*BigFloat) SubFloat64 ¶ added in v0.4.25
SubFloat64 returns a new BigFloat that is b minus a float64
func (*BigFloat) ToBigInt ¶ added in v0.4.25
ToBigInt converts the BigFloat to a BigInt (truncates toward zero)
func (*BigFloat) ToFloat64 ¶ added in v0.4.25
ToFloat64 converts the BigFloat to float64 May lose precision for very large or high-precision values
func (*BigFloat) ToInt64 ¶ added in v0.4.25
ToInt64 converts the BigFloat to int64 (truncates toward zero) Returns false if the value overflows int64
func (*BigFloat) Type ¶ added in v0.4.25
func (b *BigFloat) Type() ObjectType
Type returns the object type
type BigInt ¶ added in v0.4.25
BigInt represents an arbitrary-precision integer value It wraps Go's math/big.Int for unlimited precision integer arithmetic
func NewBigIntFromInt ¶ added in v0.4.25
NewBigIntFromInt creates a new BigInt from an Int object
func NewBigIntFromInt64 ¶ added in v0.4.25
NewBigIntFromInt64 creates a new BigInt from an int64
func NewBigIntFromString ¶ added in v0.4.25
NewBigIntFromString creates a new BigInt from a string representation The string can be in decimal, hex (0x prefix), octal (0 prefix), or binary (0b prefix)
func (*BigInt) AddInt ¶ added in v0.4.25
AddInt returns a new BigInt that is the sum of b and an int64
func (*BigInt) Cmp ¶ added in v0.4.25
Cmp compares two BigInt values Returns -1 if b < other, 0 if b == other, 1 if b > other
func (*BigInt) Div ¶ added in v0.4.25
Div returns a new BigInt that is b divided by other Returns nil if other is zero
func (*BigInt) DivInt ¶ added in v0.4.25
DivInt returns a new BigInt that is b divided by an int64 Returns nil if n is zero
func (*BigInt) Inspect ¶ added in v0.4.25
Inspect returns the string representation (without the 'n' suffix)
func (*BigInt) IsNegative ¶ added in v0.4.25
IsNegative returns true if the BigInt is negative
func (*BigInt) IsPositive ¶ added in v0.4.25
IsPositive returns true if the BigInt is positive
func (*BigInt) Mod ¶ added in v0.4.25
Mod returns a new BigInt that is b mod other Returns nil if other is zero
func (*BigInt) ModInt ¶ added in v0.4.25
ModInt returns a new BigInt that is b mod an int64 Returns nil if n is zero
func (*BigInt) MulInt ¶ added in v0.4.25
MulInt returns a new BigInt that is b multiplied by an int64
func (*BigInt) Sign ¶ added in v0.4.25
Sign returns the sign of the BigInt Returns -1 for negative, 0 for zero, 1 for positive
func (*BigInt) ToBigFloat ¶ added in v0.4.25
ToBigFloat converts the BigInt to a BigFloat
func (*BigInt) ToFloat64 ¶ added in v0.4.25
ToFloat64 converts the BigInt to float64 May lose precision for very large values
func (*BigInt) ToInt64 ¶ added in v0.4.25
ToInt64 converts the BigInt to int64 Returns false if the value overflows int64
func (*BigInt) Type ¶ added in v0.4.25
func (b *BigInt) Type() ObjectType
Type returns the object type
type Bool ¶
type Bool struct {
Value bool
}
Bool represents a boolean value
func (*Bool) Type ¶
func (b *Bool) Type() ObjectType
type Builtin ¶
type Builtin struct {
Fn BuiltinFunction
}
Builtin represents a built-in function
func GetMethod ¶
func GetMethod(objType ObjectType, name string) (*Builtin, bool)
GetMethod returns the builtin method for the given object type and method name
func (*Builtin) Type ¶
func (b *Builtin) Type() ObjectType
type BuiltinFunction ¶
BuiltinFunction is the type for built-in functions
type Bytes ¶ added in v0.4.25
type Bytes struct {
Value []byte
}
Bytes represents an immutable sequence of bytes. Unlike BytesBuffer which is mutable, Bytes is read-only after creation.
func NewBytes ¶ added in v0.4.25
NewBytes creates a new Bytes object from a byte slice. The byte slice is copied to ensure immutability.
func NewBytesFromArray ¶ added in v0.4.25
NewBytesFromArray creates a new Bytes object from an integer array. Each integer must be in range 0-255.
func (*Bytes) Contains ¶ added in v0.4.25
Contains checks if the bytes contain the given subsequence.
func (*Bytes) GetIOReader ¶ added in v0.4.25
GetIOReader returns an io.Reader for the bytes. This allows Bytes to be used with Reader objects.
func (*Bytes) HasPrefix ¶ added in v0.4.25
HasPrefix checks if the bytes start with the given prefix.
func (*Bytes) Index ¶ added in v0.4.25
Index returns the index of the first occurrence of sub. Returns -1 if not found.
func (*Bytes) LastIndex ¶ added in v0.4.25
LastIndex returns the index of the last occurrence of sub. Returns -1 if not found.
func (*Bytes) Repeat ¶ added in v0.4.25
Repeat returns a new Bytes with the content repeated n times.
func (*Bytes) String ¶ added in v0.4.25
String returns the bytes as a string (UTF-8 interpretation).
func (*Bytes) Type ¶ added in v0.4.25
func (b *Bytes) Type() ObjectType
Type returns the object type.
type BytesBuffer ¶ added in v0.4.25
type BytesBuffer struct {
// contains filtered or unexported fields
}
BytesBuffer is a mutable buffer for efficient byte operations. Not thread-safe - use external synchronization if needed.
func NewBytesBuffer ¶ added in v0.4.25
func NewBytesBuffer() *BytesBuffer
NewBytesBuffer creates a new BytesBuffer instance.
func NewBytesBufferFromBytes ¶ added in v0.4.25
func NewBytesBufferFromBytes(data []byte) *BytesBuffer
NewBytesBufferFromBytes creates a new BytesBuffer from an existing byte slice.
func (*BytesBuffer) Bytes ¶ added in v0.4.25
func (bb *BytesBuffer) Bytes() []byte
Bytes returns a copy of the buffer contents as a byte slice.
func (*BytesBuffer) BytesRef ¶ added in v0.4.25
func (bb *BytesBuffer) BytesRef() []byte
BytesRef returns a reference to the underlying byte slice (no copy). WARNING: The returned slice may be modified by subsequent buffer operations.
func (*BytesBuffer) Cap ¶ added in v0.4.25
func (bb *BytesBuffer) Cap() int
Cap returns the current capacity of the buffer.
func (*BytesBuffer) Clear ¶ added in v0.4.25
func (bb *BytesBuffer) Clear()
Clear resets the buffer, removing all content.
func (*BytesBuffer) Equals ¶ added in v0.4.25
func (bb *BytesBuffer) Equals(other *BytesBuffer) bool
Equals compares two BytesBuffer contents.
func (*BytesBuffer) GetIOReader ¶ added in v0.4.25
func (bb *BytesBuffer) GetIOReader() *bytesBufferReader
GetIOReader returns the buffer as an io.Reader interface. This allows the BytesBuffer to be used with Reader objects.
func (*BytesBuffer) GetIOWriter ¶ added in v0.4.25
func (bb *BytesBuffer) GetIOWriter() *bytesBufferWriter
GetIOWriter returns the buffer as an io.Writer interface. This allows the BytesBuffer to be used with Writer objects.
func (*BytesBuffer) Grow ¶ added in v0.4.25
func (bb *BytesBuffer) Grow(n int)
Grow grows the buffer's capacity to hold at least n more bytes.
func (*BytesBuffer) HashKey ¶ added in v0.4.25
func (bb *BytesBuffer) HashKey() HashKey
HashKey returns a hash key for the BytesBuffer.
func (*BytesBuffer) Inspect ¶ added in v0.4.25
func (bb *BytesBuffer) Inspect() string
Inspect returns a string representation.
func (*BytesBuffer) Len ¶ added in v0.4.25
func (bb *BytesBuffer) Len() int
Len returns the current length of the buffer.
func (*BytesBuffer) Peek ¶ added in v0.4.25
func (bb *BytesBuffer) Peek(n int) []byte
Peek returns the next n bytes without advancing the reader.
func (*BytesBuffer) Read ¶ added in v0.4.25
func (bb *BytesBuffer) Read(p []byte) (int, error)
Read reads up to len(p) bytes from the buffer into p. Returns the number of bytes read.
func (*BytesBuffer) ReadByte ¶ added in v0.4.25
func (bb *BytesBuffer) ReadByte() (byte, error)
ReadByte reads and returns the next byte from the buffer.
func (*BytesBuffer) ReadBytes ¶ added in v0.4.25
func (bb *BytesBuffer) ReadBytes(delim byte) ([]byte, error)
ReadBytes reads until the first occurrence of delim in the input.
func (*BytesBuffer) ReadFloat32 ¶ added in v0.4.25
func (bb *BytesBuffer) ReadFloat32() (float32, error)
ReadFloat32 reads a 32-bit float in little-endian format.
func (*BytesBuffer) ReadFloat64 ¶ added in v0.4.25
func (bb *BytesBuffer) ReadFloat64() (float64, error)
ReadFloat64 reads a 64-bit float in little-endian format.
func (*BytesBuffer) ReadInt16 ¶ added in v0.4.25
func (bb *BytesBuffer) ReadInt16() (int16, error)
ReadInt16 reads a 16-bit integer in little-endian format.
func (*BytesBuffer) ReadInt32 ¶ added in v0.4.25
func (bb *BytesBuffer) ReadInt32() (int32, error)
ReadInt32 reads a 32-bit integer in little-endian format.
func (*BytesBuffer) ReadInt64 ¶ added in v0.4.25
func (bb *BytesBuffer) ReadInt64() (int64, error)
ReadInt64 reads a 64-bit integer in little-endian format.
func (*BytesBuffer) ReadString ¶ added in v0.4.25
func (bb *BytesBuffer) ReadString(delim byte) (string, error)
ReadString reads until the first occurrence of delim in the input.
func (*BytesBuffer) Reset ¶ added in v0.4.25
func (bb *BytesBuffer) Reset()
Reset is an alias for Clear.
func (*BytesBuffer) Seek ¶ added in v0.4.25
func (bb *BytesBuffer) Seek(offset int64, whence int) int64
Seek sets the position for the next Read or Write. This is a simplified version that resets and writes the data back.
func (*BytesBuffer) String ¶ added in v0.4.25
func (bb *BytesBuffer) String() string
String returns the buffer contents as a string.
func (*BytesBuffer) ToBool ¶ added in v0.4.25
func (bb *BytesBuffer) ToBool() *Bool
ToBool returns true (BytesBuffer is always truthy).
func (*BytesBuffer) Truncate ¶ added in v0.4.25
func (bb *BytesBuffer) Truncate(n int)
Truncate discards all but the first n bytes.
func (*BytesBuffer) Type ¶ added in v0.4.25
func (bb *BytesBuffer) Type() ObjectType
Type returns the object type.
func (*BytesBuffer) TypeTag ¶ added in v0.4.25
func (bb *BytesBuffer) TypeTag() TypeTag
TypeTag returns the fast type tag.
func (*BytesBuffer) Write ¶ added in v0.4.25
func (bb *BytesBuffer) Write(data []byte) int
Write appends bytes to the buffer.
func (*BytesBuffer) WriteByte ¶ added in v0.4.25
func (bb *BytesBuffer) WriteByte(b byte) error
WriteByte appends a single byte to the buffer.
func (*BytesBuffer) WriteFloat32 ¶ added in v0.4.25
func (bb *BytesBuffer) WriteFloat32(v float32) error
WriteFloat32 appends a 32-bit float in little-endian format.
func (*BytesBuffer) WriteFloat64 ¶ added in v0.4.25
func (bb *BytesBuffer) WriteFloat64(v float64) error
WriteFloat64 appends a 64-bit float in little-endian format.
func (*BytesBuffer) WriteInt16 ¶ added in v0.4.25
func (bb *BytesBuffer) WriteInt16(v int16) error
WriteInt16 appends a 16-bit integer in little-endian format.
func (*BytesBuffer) WriteInt32 ¶ added in v0.4.25
func (bb *BytesBuffer) WriteInt32(v int32) error
WriteInt32 appends a 32-bit integer in little-endian format.
func (*BytesBuffer) WriteInt64 ¶ added in v0.4.25
func (bb *BytesBuffer) WriteInt64(v int64) error
WriteInt64 appends a 64-bit integer in little-endian format.
func (*BytesBuffer) WriteString ¶ added in v0.4.25
func (bb *BytesBuffer) WriteString(s string) int
WriteString appends a string to the buffer as bytes.
func (*BytesBuffer) WriteTo ¶ added in v0.4.25
func (bb *BytesBuffer) WriteTo(other *BytesBuffer) (int64, error)
WriteTo writes the buffer contents to another BytesBuffer.
type Cell ¶ added in v0.5.2
type Cell struct {
Value string
Type string // "s"=shared string, "n"=number, "b"=bool, "str"=string, "d"=date
Formula string
StyleIdx int
}
Cell represents a cell.
type Chars ¶ added in v0.4.25
type Chars struct {
Value []rune
}
Chars represents a sequence of Unicode code points ([]rune in Go). Unlike String which is UTF-8 encoded bytes, Chars operates on character level, making it suitable for proper Unicode text processing.
func NewCharsFromString ¶ added in v0.4.25
NewCharsFromString creates a new Chars object from a string
func (*Chars) Type ¶ added in v0.4.25
func (c *Chars) Type() ObjectType
Type returns the object type
type Class ¶
type Class struct {
Name string
SuperClass *Class
Methods map[string]Object // methods are CompiledFunction objects
InitMethod Object // constructor method
Fields map[string]Object // default field values
}
Class represents a class definition
func (*Class) Type ¶
func (c *Class) Type() ObjectType
type CompiledFunction ¶
CompiledFunction represents a compiled function for the VM
func (*CompiledFunction) HashKey ¶
func (cf *CompiledFunction) HashKey() HashKey
func (*CompiledFunction) Inspect ¶
func (cf *CompiledFunction) Inspect() string
func (*CompiledFunction) ToBool ¶
func (cf *CompiledFunction) ToBool() *Bool
func (*CompiledFunction) Type ¶
func (cf *CompiledFunction) Type() ObjectType
func (*CompiledFunction) TypeTag ¶
func (cf *CompiledFunction) TypeTag() TypeTag
type Cond ¶ added in v0.4.25
type Cond struct {
// contains filtered or unexported fields
}
Cond wraps sync.Cond for use in Xxlang
func (*Cond) Broadcast ¶ added in v0.4.25
func (c *Cond) Broadcast()
Broadcast wakes all goroutines waiting on the condition
func (*Cond) Signal ¶ added in v0.4.25
func (c *Cond) Signal()
Signal wakes one goroutine waiting on the condition
func (*Cond) Type ¶ added in v0.4.25
func (c *Cond) Type() ObjectType
Object interface implementation
type Context ¶ added in v0.4.25
type Context struct {
// contains filtered or unexported fields
}
Context represents a cancellation context
func NewBackgroundContext ¶ added in v0.4.25
func NewBackgroundContext() *Context
NewBackgroundContext creates a background context (never cancels)
func NewContext ¶ added in v0.4.25
func NewContext(ctx context.Context, cancel context.CancelFunc) *Context
NewContext creates a new context
func NewContextWithCancel ¶ added in v0.4.25
NewContextWithCancel creates a context that can be cancelled manually
func NewContextWithDeadline ¶ added in v0.4.25
NewContextWithDeadline creates a context that cancels at deadline
func NewContextWithTimeout ¶ added in v0.4.25
NewContextWithTimeout creates a context that cancels after duration
func (*Context) Deadline ¶ added in v0.4.25
Deadline returns the deadline time and whether a deadline is set
func (*Context) DeadlineString ¶ added in v0.4.25
DeadlineString returns the deadline as a string
func (*Context) Done ¶ added in v0.4.25
Done returns the done tube (creates it lazily) The tube is a zero-buffer tube that gets closed when context is done
func (*Context) Type ¶ added in v0.4.25
func (c *Context) Type() ObjectType
Type returns the object type
type CronField ¶ added in v0.5.13
type CronField struct {
// contains filtered or unexported fields
}
CronField represents a cron field with valid values
type CronSchedule ¶ added in v0.5.13
type CronSchedule struct {
// contains filtered or unexported fields
}
CronSchedule represents a parsed cron schedule
func ParseCron ¶ added in v0.5.13
func ParseCron(expr string) (*CronSchedule, error)
ParseCron parses a cron expression and returns a schedule This is exported for use by the task stdlib module
func (*CronSchedule) Matches ¶ added in v0.5.13
func (s *CronSchedule) Matches(t time.Time) bool
Matches checks if the given time matches the cron schedule
func (*CronSchedule) Next ¶ added in v0.5.13
func (s *CronSchedule) Next(after time.Time) time.Time
Next returns the next time the cron schedule will fire after the given time
func (*CronSchedule) String ¶ added in v0.5.13
func (s *CronSchedule) String() string
String returns the string representation of the cron schedule
type DB ¶ added in v0.4.36
type DB struct {
// Value is the underlying Go sql.DB connection
Value *sql.DB
// DriverName is the name of the database driver (e.g., "sqlite3", "mysql")
DriverName string
// DataSourceName is the connection string
DataSourceName string
// contains filtered or unexported fields
}
DB represents a database connection. It wraps the standard sql.DB and provides methods for querying and executing SQL.
func (*DB) Inspect ¶ added in v0.4.36
Inspect returns a string representation of the database connection.
type DBRows ¶ added in v0.4.36
type DBRows struct {
// Value is the underlying Go sql.Rows
Value *sql.Rows
// contains filtered or unexported fields
}
DBRows represents database query results. It wraps sql.Rows and provides iteration methods.
func (*DBRows) ToBool ¶ added in v0.4.36
ToBool converts the rows to a boolean (true if not closed).
func (*DBRows) Type ¶ added in v0.4.36
func (r *DBRows) Type() ObjectType
Type returns the object type.
type DBStmt ¶ added in v0.4.36
type DBStmt struct {
// Value is the underlying Go sql.Stmt
Value *sql.Stmt
// DB is the parent database connection
DB *DB
// contains filtered or unexported fields
}
DBStmt represents a prepared statement. It wraps sql.Stmt and provides execution methods.
func (*DBStmt) ToBool ¶ added in v0.4.36
ToBool converts the statement to a boolean (true if not closed).
func (*DBStmt) Type ¶ added in v0.4.36
func (s *DBStmt) Type() ObjectType
Type returns the object type.
type DBTx ¶ added in v0.4.36
type DBTx struct {
// Value is the underlying Go sql.Tx
Value *sql.Tx
// DB is the parent database connection
DB *DB
// contains filtered or unexported fields
}
DBTx represents a database transaction. It provides methods for transactional operations.
func (*DBTx) MarkClosed ¶ added in v0.4.36
func (tx *DBTx) MarkClosed()
MarkClosed marks the transaction as closed.
func (*DBTx) ToBool ¶ added in v0.4.36
ToBool converts the transaction to a boolean (true if active).
func (*DBTx) Type ¶ added in v0.4.36
func (tx *DBTx) Type() ObjectType
Type returns the object type.
type DocxBookmark ¶ added in v0.5.13
type DocxBookmark struct {
// contains filtered or unexported fields
}
DocxBookmark represents a bookmark in the document.
func (*DocxBookmark) HashKey ¶ added in v0.5.13
func (b *DocxBookmark) HashKey() HashKey
func (*DocxBookmark) Inspect ¶ added in v0.5.13
func (b *DocxBookmark) Inspect() string
func (*DocxBookmark) ToBool ¶ added in v0.5.13
func (b *DocxBookmark) ToBool() *Bool
func (*DocxBookmark) Type ¶ added in v0.5.13
func (b *DocxBookmark) Type() ObjectType
Type implementations for DocxBookmark
func (*DocxBookmark) TypeTag ¶ added in v0.5.13
func (b *DocxBookmark) TypeTag() TypeTag
type DocxChart ¶ added in v0.5.13
type DocxChart struct {
// contains filtered or unexported fields
}
DocxChart represents a chart.
func (*DocxChart) Type ¶ added in v0.5.13
func (c *DocxChart) Type() ObjectType
Type implementations for DocxChart
type DocxComment ¶ added in v0.5.13
type DocxComment struct {
// contains filtered or unexported fields
}
DocxComment represents a comment.
func (*DocxComment) HashKey ¶ added in v0.5.13
func (c *DocxComment) HashKey() HashKey
func (*DocxComment) Inspect ¶ added in v0.5.13
func (c *DocxComment) Inspect() string
func (*DocxComment) ToBool ¶ added in v0.5.13
func (c *DocxComment) ToBool() *Bool
func (*DocxComment) Type ¶ added in v0.5.13
func (c *DocxComment) Type() ObjectType
Type implementations for DocxComment
func (*DocxComment) TypeTag ¶ added in v0.5.13
func (c *DocxComment) TypeTag() TypeTag
type DocxDocument ¶ added in v0.5.13
type DocxDocument struct {
// contains filtered or unexported fields
}
DocxDocument represents a Microsoft Word document (.docx). A .docx file is a ZIP archive containing XML files.
func NewDocxDocument ¶ added in v0.5.13
func NewDocxDocument() *DocxDocument
NewDocxDocument creates a new empty Word document.
func OpenDocx ¶ added in v0.5.13
func OpenDocx(path string) (*DocxDocument, error)
OpenDocx opens an existing Word document from a file path.
func OpenDocxFromBytes ¶ added in v0.5.13
func OpenDocxFromBytes(data []byte) (*DocxDocument, error)
OpenDocxFromBytes opens a Word document from a byte slice.
func (*DocxDocument) AddMediaFile ¶ added in v0.5.13
func (d *DocxDocument) AddMediaFile(data []byte, ext string) string
AddMediaFile adds a media file to the document.
func (*DocxDocument) AddRelationship ¶ added in v0.5.13
func (d *DocxDocument) AddRelationship(relType, target string) string
AddRelationship adds a relationship to the document.
func (*DocxDocument) Close ¶ added in v0.5.13
func (d *DocxDocument) Close() error
Close closes the document and releases resources.
func (*DocxDocument) FindElements ¶ added in v0.5.13
func (d *DocxDocument) FindElements(path string) *Array
FindElements finds elements by name, trying both with and without namespace prefix.
func (*DocxDocument) FindFirstElement ¶ added in v0.5.13
func (d *DocxDocument) FindFirstElement(path string) *XMLNode
FindFirstElement finds the first element by name, trying both with and without namespace prefix.
func (*DocxDocument) GetBody ¶ added in v0.5.13
func (d *DocxDocument) GetBody() *XMLNode
GetBody returns the body element of the document.
func (*DocxDocument) GetProperties ¶ added in v0.5.13
func (d *DocxDocument) GetProperties() *DocxProperties
GetProperties returns the document properties.
func (*DocxDocument) GetXMLDoc ¶ added in v0.5.13
func (d *DocxDocument) GetXMLDoc() *XMLDocument
GetXMLDoc returns the underlying XML document.
func (*DocxDocument) HashKey ¶ added in v0.5.13
func (d *DocxDocument) HashKey() HashKey
func (*DocxDocument) Inspect ¶ added in v0.5.13
func (d *DocxDocument) Inspect() string
func (*DocxDocument) IsModified ¶ added in v0.5.13
func (d *DocxDocument) IsModified() bool
IsModified returns whether the document has been modified.
func (*DocxDocument) Save ¶ added in v0.5.13
func (d *DocxDocument) Save(path string) error
Save saves the document to a file.
func (*DocxDocument) SetModified ¶ added in v0.5.13
func (d *DocxDocument) SetModified(modified bool)
SetModified sets the modified flag.
func (*DocxDocument) ToBool ¶ added in v0.5.13
func (d *DocxDocument) ToBool() *Bool
func (*DocxDocument) ToBytes ¶ added in v0.5.13
func (d *DocxDocument) ToBytes() ([]byte, error)
ToBytes converts the document to a byte slice.
func (*DocxDocument) Type ¶ added in v0.5.13
func (d *DocxDocument) Type() ObjectType
Type implementations for DocxDocument
func (*DocxDocument) TypeTag ¶ added in v0.5.13
func (d *DocxDocument) TypeTag() TypeTag
type DocxEndnote ¶ added in v0.5.13
type DocxEndnote struct {
// contains filtered or unexported fields
}
DocxEndnote represents an endnote.
func (*DocxEndnote) HashKey ¶ added in v0.5.13
func (e *DocxEndnote) HashKey() HashKey
func (*DocxEndnote) Inspect ¶ added in v0.5.13
func (e *DocxEndnote) Inspect() string
func (*DocxEndnote) ToBool ¶ added in v0.5.13
func (e *DocxEndnote) ToBool() *Bool
func (*DocxEndnote) Type ¶ added in v0.5.13
func (e *DocxEndnote) Type() ObjectType
Type implementations for DocxEndnote
func (*DocxEndnote) TypeTag ¶ added in v0.5.13
func (e *DocxEndnote) TypeTag() TypeTag
type DocxFooter ¶ added in v0.5.13
type DocxFooter struct {
// contains filtered or unexported fields
}
DocxFooter represents a document footer.
func (*DocxFooter) HashKey ¶ added in v0.5.13
func (f *DocxFooter) HashKey() HashKey
func (*DocxFooter) Inspect ¶ added in v0.5.13
func (f *DocxFooter) Inspect() string
func (*DocxFooter) ToBool ¶ added in v0.5.13
func (f *DocxFooter) ToBool() *Bool
func (*DocxFooter) Type ¶ added in v0.5.13
func (f *DocxFooter) Type() ObjectType
Type implementations for DocxFooter
func (*DocxFooter) TypeTag ¶ added in v0.5.13
func (f *DocxFooter) TypeTag() TypeTag
type DocxFootnote ¶ added in v0.5.13
type DocxFootnote struct {
// contains filtered or unexported fields
}
DocxFootnote represents a footnote.
func (*DocxFootnote) HashKey ¶ added in v0.5.13
func (f *DocxFootnote) HashKey() HashKey
func (*DocxFootnote) Inspect ¶ added in v0.5.13
func (f *DocxFootnote) Inspect() string
func (*DocxFootnote) ToBool ¶ added in v0.5.13
func (f *DocxFootnote) ToBool() *Bool
func (*DocxFootnote) Type ¶ added in v0.5.13
func (f *DocxFootnote) Type() ObjectType
Type implementations for DocxFootnote
func (*DocxFootnote) TypeTag ¶ added in v0.5.13
func (f *DocxFootnote) TypeTag() TypeTag
type DocxHeader ¶ added in v0.5.13
type DocxHeader struct {
// contains filtered or unexported fields
}
DocxHeader represents a document header.
func (*DocxHeader) HashKey ¶ added in v0.5.13
func (h *DocxHeader) HashKey() HashKey
func (*DocxHeader) Inspect ¶ added in v0.5.13
func (h *DocxHeader) Inspect() string
func (*DocxHeader) ToBool ¶ added in v0.5.13
func (h *DocxHeader) ToBool() *Bool
func (*DocxHeader) Type ¶ added in v0.5.13
func (h *DocxHeader) Type() ObjectType
Type implementations for DocxHeader
func (*DocxHeader) TypeTag ¶ added in v0.5.13
func (h *DocxHeader) TypeTag() TypeTag
type DocxHyperlink ¶ added in v0.5.13
type DocxHyperlink struct {
// contains filtered or unexported fields
}
DocxHyperlink represents a hyperlink in the document.
func (*DocxHyperlink) HashKey ¶ added in v0.5.13
func (h *DocxHyperlink) HashKey() HashKey
func (*DocxHyperlink) Inspect ¶ added in v0.5.13
func (h *DocxHyperlink) Inspect() string
func (*DocxHyperlink) ToBool ¶ added in v0.5.13
func (h *DocxHyperlink) ToBool() *Bool
func (*DocxHyperlink) Type ¶ added in v0.5.13
func (h *DocxHyperlink) Type() ObjectType
Type implementations for DocxHyperlink
func (*DocxHyperlink) TypeTag ¶ added in v0.5.13
func (h *DocxHyperlink) TypeTag() TypeTag
type DocxImage ¶ added in v0.5.13
type DocxImage struct {
// contains filtered or unexported fields
}
DocxImage represents an image in a Word document.
func (*DocxImage) Type ¶ added in v0.5.13
func (i *DocxImage) Type() ObjectType
Type implementations for DocxImage
type DocxParagraph ¶ added in v0.5.13
type DocxParagraph struct {
Document *DocxDocument
XmlNode *XMLNode
// contains filtered or unexported fields
}
DocxParagraph represents a paragraph in a Word document.
func (*DocxParagraph) HashKey ¶ added in v0.5.13
func (p *DocxParagraph) HashKey() HashKey
func (*DocxParagraph) Inspect ¶ added in v0.5.13
func (p *DocxParagraph) Inspect() string
func (*DocxParagraph) ToBool ¶ added in v0.5.13
func (p *DocxParagraph) ToBool() *Bool
func (*DocxParagraph) Type ¶ added in v0.5.13
func (p *DocxParagraph) Type() ObjectType
Type implementations for DocxParagraph
func (*DocxParagraph) TypeTag ¶ added in v0.5.13
func (p *DocxParagraph) TypeTag() TypeTag
type DocxProperties ¶ added in v0.5.13
type DocxProperties struct {
Title string
Subject string
Author string
Keywords string
Description string
Created string
Modified string
LastModBy string
Revision int
Category string
ContentStat string
Application string
AppVersion string
Pages int
Words int
Characters int
Lines int
Paragraphs int
}
DocxProperties holds document metadata.
type DocxRevision ¶ added in v0.5.13
type DocxRevision struct {
// contains filtered or unexported fields
}
DocxRevision represents a revision (tracked change).
func (*DocxRevision) HashKey ¶ added in v0.5.13
func (r *DocxRevision) HashKey() HashKey
func (*DocxRevision) Inspect ¶ added in v0.5.13
func (r *DocxRevision) Inspect() string
func (*DocxRevision) ToBool ¶ added in v0.5.13
func (r *DocxRevision) ToBool() *Bool
func (*DocxRevision) Type ¶ added in v0.5.13
func (r *DocxRevision) Type() ObjectType
Type implementations for DocxRevision
func (*DocxRevision) TypeTag ¶ added in v0.5.13
func (r *DocxRevision) TypeTag() TypeTag
type DocxRun ¶ added in v0.5.13
type DocxRun struct {
Paragraph *DocxParagraph
XmlNode *XMLNode
// contains filtered or unexported fields
}
DocxRun represents a text run within a paragraph.
func (*DocxRun) Type ¶ added in v0.5.13
func (r *DocxRun) Type() ObjectType
Type implementations for DocxRun
type DocxSection ¶ added in v0.5.13
type DocxSection struct {
// contains filtered or unexported fields
}
DocxSection represents a document section.
func (*DocxSection) HashKey ¶ added in v0.5.13
func (s *DocxSection) HashKey() HashKey
func (*DocxSection) Inspect ¶ added in v0.5.13
func (s *DocxSection) Inspect() string
func (*DocxSection) ToBool ¶ added in v0.5.13
func (s *DocxSection) ToBool() *Bool
func (*DocxSection) Type ¶ added in v0.5.13
func (s *DocxSection) Type() ObjectType
Type implementations for DocxSection
func (*DocxSection) TypeTag ¶ added in v0.5.13
func (s *DocxSection) TypeTag() TypeTag
type DocxShape ¶ added in v0.5.13
type DocxShape struct {
// contains filtered or unexported fields
}
DocxShape represents a shape.
func (*DocxShape) Type ¶ added in v0.5.13
func (s *DocxShape) Type() ObjectType
Type implementations for DocxShape
type DocxStyle ¶ added in v0.5.13
type DocxStyle struct {
// contains filtered or unexported fields
}
DocxStyle represents a document style.
func (*DocxStyle) Type ¶ added in v0.5.13
func (s *DocxStyle) Type() ObjectType
Type implementations for DocxStyle
type DocxTOC ¶ added in v0.5.13
type DocxTOC struct {
// contains filtered or unexported fields
}
DocxTOC represents a table of contents.
func (*DocxTOC) Type ¶ added in v0.5.13
func (t *DocxTOC) Type() ObjectType
Type implementations for DocxTOC
type DocxTable ¶ added in v0.5.13
type DocxTable struct {
Document *DocxDocument
XmlNode *XMLNode
// Cached dimensions
Rows int
Cols int
}
DocxTable represents a table in a Word document.
func (*DocxTable) Type ¶ added in v0.5.13
func (t *DocxTable) Type() ObjectType
Type implementations for DocxTable
type DocxTableCell ¶ added in v0.5.13
type DocxTableCell struct {
Row *DocxTableRow
XmlNode *XMLNode
ColIdx int
}
DocxTableCell represents a table cell.
func (*DocxTableCell) HashKey ¶ added in v0.5.13
func (c *DocxTableCell) HashKey() HashKey
func (*DocxTableCell) Inspect ¶ added in v0.5.13
func (c *DocxTableCell) Inspect() string
func (*DocxTableCell) ToBool ¶ added in v0.5.13
func (c *DocxTableCell) ToBool() *Bool
func (*DocxTableCell) Type ¶ added in v0.5.13
func (c *DocxTableCell) Type() ObjectType
Type implementations for DocxTableCell
func (*DocxTableCell) TypeTag ¶ added in v0.5.13
func (c *DocxTableCell) TypeTag() TypeTag
type DocxTableRow ¶ added in v0.5.13
DocxTableRow represents a table row.
func (*DocxTableRow) HashKey ¶ added in v0.5.13
func (r *DocxTableRow) HashKey() HashKey
func (*DocxTableRow) Inspect ¶ added in v0.5.13
func (r *DocxTableRow) Inspect() string
func (*DocxTableRow) ToBool ¶ added in v0.5.13
func (r *DocxTableRow) ToBool() *Bool
func (*DocxTableRow) Type ¶ added in v0.5.13
func (r *DocxTableRow) Type() ObjectType
Type implementations for DocxTableRow
func (*DocxTableRow) TypeTag ¶ added in v0.5.13
func (r *DocxTableRow) TypeTag() TypeTag
type DocxTextBox ¶ added in v0.5.13
type DocxTextBox struct {
// contains filtered or unexported fields
}
DocxTextBox represents a text box.
func (*DocxTextBox) HashKey ¶ added in v0.5.13
func (t *DocxTextBox) HashKey() HashKey
func (*DocxTextBox) Inspect ¶ added in v0.5.13
func (t *DocxTextBox) Inspect() string
func (*DocxTextBox) ToBool ¶ added in v0.5.13
func (t *DocxTextBox) ToBool() *Bool
func (*DocxTextBox) Type ¶ added in v0.5.13
func (t *DocxTextBox) Type() ObjectType
Type implementations for DocxTextBox
func (*DocxTextBox) TypeTag ¶ added in v0.5.13
func (t *DocxTextBox) TypeTag() TypeTag
type Environment ¶
type Environment struct {
Store map[string]Object
Outer *Environment
}
Environment represents a variable scope
func NewEnclosedEnvironment ¶
func NewEnclosedEnvironment(outer *Environment) *Environment
NewEnclosedEnvironment creates a new environment with an outer scope
type Error ¶
type Error struct {
Message string
}
Error represents a runtime error
func (*Error) Type ¶
func (e *Error) Type() ObjectType
type File ¶ added in v0.4.25
type File struct {
Handle *os.File // The underlying OS file handle
Path string // The file path
Mode FileMode // The mode the file was opened with
Open bool // Whether the file is currently open
Position int64 // Current position in the file
LockType FileLockType // Current lock type (0 = unlocked)
// contains filtered or unexported fields
}
File represents an open file handle for streaming I/O operations. It wraps os.File and provides methods for reading, writing, seeking, and managing file state.
func (*File) Close ¶ added in v0.4.25
Close closes the file handle. Returns nil on success, error otherwise.
func (*File) Lock ¶ added in v0.4.25
func (f *File) Lock(lockType FileLockType, blocking bool) error
Lock places a lock on the file. lockType: 1 = shared, 2 = exclusive Non-blocking: returns immediately if lock cannot be acquired.
func (*File) Read ¶ added in v0.4.25
Read reads up to n bytes from the file. Returns the bytes read as an array of integers.
func (*File) ReadLine ¶ added in v0.4.25
ReadLine reads a single line from the file. Returns the line as a string without the trailing newline.
func (*File) Seek ¶ added in v0.4.25
Seek sets the file position. Whence: 0 = start, 1 = current, 2 = end
type FileInfo ¶ added in v0.4.25
type FileInfo struct {
Name string // Base name of the file
Size int64 // Length in bytes
Mode uint32 // File mode bits
ModTime time.Time // Modification time
IsDir bool // Whether it's a directory
FullPath string // Full path to the file
}
FileInfo wraps os.FileInfo for use in Xxlang.
func NewFileInfo ¶ added in v0.4.25
NewFileInfo creates a new FileInfo from os.FileInfo.
func (*FileInfo) GetModTimeString ¶ added in v0.4.25
GetModTimeString returns the modification time as a formatted string.
func (*FileInfo) GetModTimeUnix ¶ added in v0.4.25
GetModTimeUnix returns the modification time as Unix timestamp (milliseconds).
func (*FileInfo) GetModeString ¶ added in v0.4.25
GetModeString returns the file mode as an octal string.
func (*FileInfo) Inspect ¶ added in v0.4.25
Inspect returns a string representation of the FileInfo.
func (*FileInfo) Type ¶ added in v0.4.25
func (fi *FileInfo) Type() ObjectType
Type returns the object type.
type FileLockType ¶ added in v0.4.25
type FileLockType int
FileLockType represents the type of file lock
const ( LockNone FileLockType = iota // No lock LockExclusive // Exclusive (write) lock )
type FileMode ¶ added in v0.4.25
type FileMode string
FileMode represents the mode in which a file is opened
type FileUpload ¶ added in v0.4.25
type FileUpload struct {
// Header is the underlying multipart.FileHeader
Header *multipart.FileHeader
// Members holds dynamically accessed members for script use
Members map[string]Object
// contains filtered or unexported fields
}
FileUpload represents an uploaded file from an HTTP request. It wraps the multipart.FileHeader and provides methods for accessing file information and saving the file to disk.
func NewFileUpload ¶ added in v0.4.25
func NewFileUpload(header *multipart.FileHeader) *FileUpload
NewFileUpload creates a new FileUpload object from a multipart.FileHeader.
func (*FileUpload) GetMember ¶ added in v0.4.25
func (f *FileUpload) GetMember(name string) Object
GetMember returns a member by name for script access.
func (*FileUpload) HashKey ¶ added in v0.4.25
func (f *FileUpload) HashKey() HashKey
HashKey returns a hash key for the file upload.
func (*FileUpload) HashSHA256 ¶ added in v0.4.25
func (f *FileUpload) HashSHA256() (string, error)
HashSHA256 calculates the SHA256 hash of the uploaded file.
func (*FileUpload) Inspect ¶ added in v0.4.25
func (f *FileUpload) Inspect() string
Inspect returns a string representation of the file upload.
func (*FileUpload) Open ¶ added in v0.4.25
func (f *FileUpload) Open() (multipart.File, error)
Open opens the uploaded file for reading. Returns an io.ReadCloser or an error.
func (*FileUpload) ReadAll ¶ added in v0.4.25
func (f *FileUpload) ReadAll() ([]byte, error)
ReadAll reads the entire content of the uploaded file. Returns the file content as a byte slice or an error.
func (*FileUpload) ReadAsString ¶ added in v0.4.25
func (f *FileUpload) ReadAsString() (string, error)
ReadAsString reads the entire content of the uploaded file as a string.
func (*FileUpload) Save ¶ added in v0.4.25
func (f *FileUpload) Save(destPath string) (string, error)
Save saves the uploaded file to the specified path. Returns the absolute path of the saved file or an error.
func (*FileUpload) SaveToDir ¶ added in v0.4.25
func (f *FileUpload) SaveToDir(dir string, autoRename bool) (string, error)
SaveToDir saves the uploaded file to the specified directory with the original filename. If autoRename is true, adds timestamp prefix to avoid name conflicts. Returns the full path of the saved file or an error.
func (*FileUpload) ToBool ¶ added in v0.4.25
func (f *FileUpload) ToBool() *Bool
ToBool converts the file upload to a boolean (true if file exists).
func (*FileUpload) Type ¶ added in v0.4.25
func (f *FileUpload) Type() ObjectType
Type returns the object type.
func (*FileUpload) TypeTag ¶ added in v0.4.25
func (f *FileUpload) TypeTag() TypeTag
TypeTag returns the type tag for fast type checking.
type FileUploadConfig ¶ added in v0.4.25
type FileUploadConfig struct {
// MaxSize is the maximum file size in bytes (0 = unlimited)
MaxSize int64
// AllowedExtensions is a list of allowed file extensions (empty = all allowed)
AllowedExtensions []string
// UploadDir is the default directory for file uploads
UploadDir string
// AutoRename indicates whether to automatically rename files on conflict
AutoRename bool
// AllowedMimeTypes is a list of allowed MIME types (empty = all allowed)
AllowedMimeTypes []string
}
FileUploadConfig holds configuration for file upload handling.
func DefaultFileUploadConfig ¶ added in v0.4.25
func DefaultFileUploadConfig() *FileUploadConfig
DefaultFileUploadConfig returns the default file upload configuration.
func (*FileUploadConfig) Validate ¶ added in v0.4.25
func (c *FileUploadConfig) Validate(file *FileUpload) error
Validate validates a file upload against the configuration.
type FileUploadResult ¶ added in v0.4.25
type FileUploadResult struct {
// Success indicates whether the operation was successful
Success bool
// Message contains the result message or error description
Message string
// FilePath is the path where the file was saved
FilePath string
// OriginalName is the original filename
OriginalName string
// Size is the file size in bytes
Size int64
}
FileUploadResult represents the result of a file upload operation.
func NewFileUploadResult ¶ added in v0.4.25
func NewFileUploadResult(success bool, message, filePath, originalName string, size int64) *FileUploadResult
NewFileUploadResult creates a new FileUploadResult object.
func (*FileUploadResult) GetMember ¶ added in v0.4.25
func (r *FileUploadResult) GetMember(name string) Object
GetMember returns a member by name for script access.
func (*FileUploadResult) HashKey ¶ added in v0.4.25
func (r *FileUploadResult) HashKey() HashKey
HashKey returns a hash key for the upload result.
func (*FileUploadResult) Inspect ¶ added in v0.4.25
func (r *FileUploadResult) Inspect() string
Inspect returns a string representation of the upload result.
func (*FileUploadResult) ToBool ¶ added in v0.4.25
func (r *FileUploadResult) ToBool() *Bool
ToBool converts the upload result to a boolean.
func (*FileUploadResult) Type ¶ added in v0.4.25
func (r *FileUploadResult) Type() ObjectType
Type returns the object type.
func (*FileUploadResult) TypeTag ¶ added in v0.4.25
func (r *FileUploadResult) TypeTag() TypeTag
TypeTag returns the type tag for fast type checking.
type Float ¶
type Float struct {
Value float64
}
Float represents a floating-point value
func GetBufferedFloat ¶ added in v0.4.23
GetBufferedFloat gets a temporary Float using the global buffer
func NewFloat ¶ added in v0.4.23
NewFloat creates a new Float object, using cached values for common floats
func NewFloatSlice ¶ added in v0.4.23
NewFloatSlice creates multiple Float objects efficiently This is optimized for batch operations
type FloatPoolStats ¶ added in v0.4.23
type FloatPoolStats struct {
// CacheHits is the number of times a cached float was returned
CacheHits int64
// PoolHits is the number of times a pooled float was reused
PoolHits int64
// Created is the number of new floats allocated by the pool
Created int64
// Released is the number of floats returned to the pool
Released int64
}
FloatPoolStats tracks statistics about float pool usage
func GetFloatPoolStats ¶ added in v0.4.23
func GetFloatPoolStats() FloatPoolStats
GetFloatPoolStats returns current statistics about float pool usage
type FtpClient ¶ added in v0.5.9
type FtpClient struct {
// contains filtered or unexported fields
}
FtpClient represents an FTP client connection.
func NewFtpClient ¶ added in v0.5.9
func NewFtpClient() *FtpClient
NewFtpClient creates a new FtpClient (unconnected).
func (*FtpClient) ConnectWithConfig ¶ added in v0.5.9
ConnectWithConfig establishes FTP connection with full configuration.
func (*FtpClient) CurrentDir ¶ added in v0.5.9
CurrentDir returns the current working directory.
func (*FtpClient) Download ¶ added in v0.5.9
Download downloads a remote file to the local filesystem.
func (*FtpClient) Inspect ¶ added in v0.5.9
Inspect returns a string representation of the FtpClient.
func (*FtpClient) IsConnected ¶ added in v0.5.9
IsConnected returns the connection status.
func (*FtpClient) ListDir ¶ added in v0.5.9
func (c *FtpClient) ListDir(remotePath string) ([]FtpFileInfo, error)
ListDir lists the contents of a remote directory.
func (*FtpClient) SetPassive ¶ added in v0.5.9
SetPassive enables or disables passive mode.
func (*FtpClient) Type ¶ added in v0.5.9
func (c *FtpClient) Type() ObjectType
Type returns the object type.
type FtpConfig ¶ added in v0.5.9
type FtpConfig struct {
Host string
Port int
User string
Password string
Timeout int // seconds
Passive bool
Binary bool
}
FtpConfig holds FTP connection configuration.
type FtpFileInfo ¶ added in v0.5.9
FileInfo represents file information from FTP listing.
type FtpServer ¶ added in v0.5.9
type FtpServer struct {
// contains filtered or unexported fields
}
FtpServer represents an FTP server.
func NewFtpServer ¶ added in v0.5.9
func NewFtpServer() *FtpServer
NewFtpServer creates a new FtpServer.
func (*FtpServer) Create ¶ added in v0.5.9
func (s *FtpServer) Create(addr string, config *FtpServerConfig) error
Create creates and configures the FTP server.
func (*FtpServer) Inspect ¶ added in v0.5.9
Inspect returns a string representation of the FtpServer.
func (*FtpServer) RemoveUser ¶ added in v0.5.9
RemoveUser removes a user account.
func (*FtpServer) Type ¶ added in v0.5.9
func (s *FtpServer) Type() ObjectType
Type returns the object type.
type FtpServerConfig ¶ added in v0.5.9
type FtpServerConfig struct {
Host string
Port int
PassivePorts string // e.g., "50000-51000"
MaxConnections int
Timeout int // seconds
WelcomeMessage string
PassivePortMin int
PassivePortMax int
}
FtpServerConfig holds FTP server configuration.
type Function ¶
type Function struct {
Parameters []*Identifier
Body interface{} // Will be *ast.BlockStatement, using interface{} to avoid import cycle
Env *Environment
Name string // Optional: for named functions
}
Function represents a user-defined function
func (*Function) Type ¶
func (f *Function) Type() ObjectType
type Goroutine ¶ added in v0.4.25
type Goroutine struct {
// contains filtered or unexported fields
}
Goroutine represents a goroutine started with 'run'
func NewGoroutine ¶ added in v0.4.25
func NewGoroutine() *Goroutine
NewGoroutine creates a new Goroutine record
func (*Goroutine) MarkFinished ¶ added in v0.4.25
func (g *Goroutine) MarkFinished()
MarkFinished marks the goroutine as finished
func (*Goroutine) MarkPanicked ¶ added in v0.4.25
func (g *Goroutine) MarkPanicked(v interface{})
MarkPanicked marks the goroutine as panicked
func (*Goroutine) PanicValue ¶ added in v0.4.25
func (g *Goroutine) PanicValue() interface{}
PanicValue returns the panic value if the goroutine panicked
func (*Goroutine) Status ¶ added in v0.4.25
func (g *Goroutine) Status() GoroutineStatus
Status returns the current status of the goroutine
func (*Goroutine) Type ¶ added in v0.4.25
func (g *Goroutine) Type() ObjectType
Object interface implementation
type GoroutineStatus ¶ added in v0.4.25
type GoroutineStatus int
GoroutineStatus represents the state of a goroutine
const ( GoroutineRunning GoroutineStatus = iota GoroutineFinished GoroutinePanicked )
type HTMLDocument ¶ added in v0.5.10
type HTMLDocument struct {
// contains filtered or unexported fields
}
HTMLDocument represents an HTML document.
func NewHTMLDocument ¶ added in v0.5.10
func NewHTMLDocument() *HTMLDocument
NewHTMLDocument creates a new HTML document.
func NewHTMLDocumentWithTitle ¶ added in v0.5.10
func NewHTMLDocumentWithTitle(title string) *HTMLDocument
NewHTMLDocumentWithTitle creates a new HTML document with a title.
func ParseHTML ¶ added in v0.5.10
func ParseHTML(htmlStr string) (*HTMLDocument, error)
ParseHTML parses an HTML string and returns an HTMLDocument.
func ParseHTMLFile ¶ added in v0.5.10
func ParseHTMLFile(path string) (*HTMLDocument, error)
ParseHTMLFile parses an HTML file and returns an HTMLDocument.
func ParseHTMLFromReader ¶ added in v0.5.10
func ParseHTMLFromReader(r io.Reader) (*HTMLDocument, error)
ParseHTMLFromReader parses HTML from an io.Reader.
func (*HTMLDocument) AddScript ¶ added in v0.5.10
func (d *HTMLDocument) AddScript(js string, src string)
AddScript adds a script tag to the body.
func (*HTMLDocument) AddStyle ¶ added in v0.5.10
func (d *HTMLDocument) AddStyle(css string)
AddStyle adds a style tag to the head.
func (*HTMLDocument) Body ¶ added in v0.5.10
func (d *HTMLDocument) Body() *HTMLElement
Body returns the body element.
func (*HTMLDocument) DocType ¶ added in v0.5.10
func (d *HTMLDocument) DocType() string
DocType returns the document type declaration.
func (*HTMLDocument) Find ¶ added in v0.5.10
func (d *HTMLDocument) Find(selector string) *Array
Find is an alias for QuerySelectorAll.
func (*HTMLDocument) FindFirst ¶ added in v0.5.10
func (d *HTMLDocument) FindFirst(selector string) *HTMLElement
FindFirst is an alias for QuerySelector.
func (*HTMLDocument) GetElementById ¶ added in v0.5.10
func (d *HTMLDocument) GetElementById(id string) *HTMLElement
GetElementById returns the element with the specified ID.
func (*HTMLDocument) GetElementsByClassName ¶ added in v0.5.10
func (d *HTMLDocument) GetElementsByClassName(className string) *Array
GetElementsByClassName returns all elements with the specified class name.
func (*HTMLDocument) GetElementsByTagName ¶ added in v0.5.10
func (d *HTMLDocument) GetElementsByTagName(tag string) *Array
GetElementsByTagName returns all elements with the specified tag name.
func (*HTMLDocument) HashKey ¶ added in v0.5.10
func (d *HTMLDocument) HashKey() HashKey
HashKey returns a hash key for the HTMLDocument.
func (*HTMLDocument) Head ¶ added in v0.5.10
func (d *HTMLDocument) Head() *HTMLElement
Head returns the head element.
func (*HTMLDocument) Inspect ¶ added in v0.5.10
func (d *HTMLDocument) Inspect() string
Inspect returns a string representation.
func (*HTMLDocument) QuerySelector ¶ added in v0.5.10
func (d *HTMLDocument) QuerySelector(selector string) *HTMLElement
QuerySelector returns the first element matching the CSS selector.
func (*HTMLDocument) QuerySelectorAll ¶ added in v0.5.10
func (d *HTMLDocument) QuerySelectorAll(selector string) *Array
QuerySelectorAll returns all elements matching the CSS selector.
func (*HTMLDocument) Root ¶ added in v0.5.10
func (d *HTMLDocument) Root() *HTMLElement
Root returns the root element.
func (*HTMLDocument) Save ¶ added in v0.5.10
func (d *HTMLDocument) Save(path string) error
Save saves the document to a file.
func (*HTMLDocument) SetMeta ¶ added in v0.5.10
func (d *HTMLDocument) SetMeta(name, content string)
SetMeta sets a meta tag in the head.
func (*HTMLDocument) SetRoot ¶ added in v0.5.10
func (d *HTMLDocument) SetRoot(root *HTMLElement)
SetRoot sets the root element.
func (*HTMLDocument) SetTitle ¶ added in v0.5.10
func (d *HTMLDocument) SetTitle(title string)
SetTitle sets the document title.
func (*HTMLDocument) Title ¶ added in v0.5.10
func (d *HTMLDocument) Title() string
Title returns the document title.
func (*HTMLDocument) ToBool ¶ added in v0.5.10
func (d *HTMLDocument) ToBool() *Bool
ToBool returns true (HTMLDocument is always truthy).
func (*HTMLDocument) ToIndented ¶ added in v0.5.10
func (d *HTMLDocument) ToIndented() string
ToIndented converts the document to indented HTML string.
func (*HTMLDocument) ToMap ¶ added in v0.5.10
func (d *HTMLDocument) ToMap() *Map
ToMap converts the document to a Map.
func (*HTMLDocument) ToString ¶ added in v0.5.10
func (d *HTMLDocument) ToString() string
ToString converts the document to HTML string.
func (*HTMLDocument) Type ¶ added in v0.5.10
func (d *HTMLDocument) Type() ObjectType
Type returns the object type.
func (*HTMLDocument) TypeTag ¶ added in v0.5.10
func (d *HTMLDocument) TypeTag() TypeTag
TypeTag returns the fast type tag.
type HTMLElement ¶ added in v0.5.10
type HTMLElement struct {
// contains filtered or unexported fields
}
HTMLElement represents an HTML element node.
func NewHTMLComment ¶ added in v0.5.10
func NewHTMLComment(text string) *HTMLElement
NewHTMLComment creates a new comment node.
func NewHTMLElement ¶ added in v0.5.10
func NewHTMLElement(tagName string) *HTMLElement
NewHTMLElement creates a new HTML element.
func NewHTMLTextNode ¶ added in v0.5.10
func NewHTMLTextNode(text string) *HTMLElement
NewHTMLTextNode creates a new text node.
func ParseHTMLFragment ¶ added in v0.5.10
func ParseHTMLFragment(htmlStr string) ([]*HTMLElement, error)
ParseHTMLFragment parses an HTML fragment and returns elements.
func (*HTMLElement) AddClass ¶ added in v0.5.10
func (e *HTMLElement) AddClass(className string)
AddClass adds a class to the element.
func (*HTMLElement) AppendChild ¶ added in v0.5.10
func (e *HTMLElement) AppendChild(child *HTMLElement)
AppendChild appends a child element.
func (*HTMLElement) Attribute ¶ added in v0.5.10
func (e *HTMLElement) Attribute(name string) string
Attribute returns the attribute value by name.
func (*HTMLElement) Attributes ¶ added in v0.5.10
func (e *HTMLElement) Attributes() *Map
Attributes returns all attributes as a Map.
func (*HTMLElement) ChildCount ¶ added in v0.5.10
func (e *HTMLElement) ChildCount() int
ChildCount returns the number of children.
func (*HTMLElement) Children ¶ added in v0.5.10
func (e *HTMLElement) Children() *Array
Children returns all child elements.
func (*HTMLElement) Class ¶ added in v0.5.10
func (e *HTMLElement) Class() string
Class returns the class attribute.
func (*HTMLElement) Clear ¶ added in v0.5.10
func (e *HTMLElement) Clear()
Clear removes all children.
func (*HTMLElement) Clone ¶ added in v0.5.10
func (e *HTMLElement) Clone() *HTMLElement
Clone returns a deep clone of the element.
func (*HTMLElement) Find ¶ added in v0.5.10
func (e *HTMLElement) Find(selector string) *Array
Find is an alias for QuerySelectorAll.
func (*HTMLElement) FindFirst ¶ added in v0.5.10
func (e *HTMLElement) FindFirst(selector string) *HTMLElement
FindFirst is an alias for QuerySelector.
func (*HTMLElement) FirstChild ¶ added in v0.5.10
func (e *HTMLElement) FirstChild() *HTMLElement
FirstChild returns the first child element.
func (*HTMLElement) HasAttribute ¶ added in v0.5.10
func (e *HTMLElement) HasAttribute(name string) bool
HasAttribute checks if an attribute exists.
func (*HTMLElement) HasClass ¶ added in v0.5.10
func (e *HTMLElement) HasClass(className string) bool
HasClass checks if the element has a class.
func (*HTMLElement) HashKey ¶ added in v0.5.10
func (e *HTMLElement) HashKey() HashKey
HashKey returns a hash key for the HTMLElement.
func (*HTMLElement) ID ¶ added in v0.5.10
func (e *HTMLElement) ID() string
ID returns the id attribute.
func (*HTMLElement) InnerHTML ¶ added in v0.5.10
func (e *HTMLElement) InnerHTML() string
InnerHTML returns the inner HTML.
func (*HTMLElement) InsertAfter ¶ added in v0.5.10
func (e *HTMLElement) InsertAfter(newElem, refElem *HTMLElement) bool
InsertAfter inserts a new element after a reference element.
func (*HTMLElement) InsertBefore ¶ added in v0.5.10
func (e *HTMLElement) InsertBefore(newElem, refElem *HTMLElement) bool
InsertBefore inserts a new element before a reference element.
func (*HTMLElement) Inspect ¶ added in v0.5.10
func (e *HTMLElement) Inspect() string
Inspect returns a string representation.
func (*HTMLElement) LastChild ¶ added in v0.5.10
func (e *HTMLElement) LastChild() *HTMLElement
LastChild returns the last child element.
func (*HTMLElement) NodeType ¶ added in v0.5.10
func (e *HTMLElement) NodeType() HTMLNodeType
NodeType returns the node type.
func (*HTMLElement) OuterHTML ¶ added in v0.5.10
func (e *HTMLElement) OuterHTML() string
OuterHTML returns the outer HTML.
func (*HTMLElement) Parent ¶ added in v0.5.10
func (e *HTMLElement) Parent() *HTMLElement
Parent returns the parent element.
func (*HTMLElement) QuerySelector ¶ added in v0.5.10
func (e *HTMLElement) QuerySelector(selector string) *HTMLElement
QuerySelector returns the first element matching the CSS selector.
func (*HTMLElement) QuerySelectorAll ¶ added in v0.5.10
func (e *HTMLElement) QuerySelectorAll(selector string) *Array
QuerySelectorAll returns all elements matching the CSS selector.
func (*HTMLElement) Remove ¶ added in v0.5.10
func (e *HTMLElement) Remove()
Remove removes the element from its parent.
func (*HTMLElement) RemoveAttribute ¶ added in v0.5.10
func (e *HTMLElement) RemoveAttribute(name string)
RemoveAttribute removes an attribute.
func (*HTMLElement) RemoveChild ¶ added in v0.5.10
func (e *HTMLElement) RemoveChild(index int) bool
RemoveChild removes a child element by index.
func (*HTMLElement) RemoveClass ¶ added in v0.5.10
func (e *HTMLElement) RemoveClass(className string)
RemoveClass removes a class from the element.
func (*HTMLElement) ReplaceChild ¶ added in v0.5.10
func (e *HTMLElement) ReplaceChild(newElem, oldElem *HTMLElement) bool
ReplaceChild replaces a child element with a new element.
func (*HTMLElement) SetAttribute ¶ added in v0.5.10
func (e *HTMLElement) SetAttribute(name, value string)
SetAttribute sets an attribute.
func (*HTMLElement) SetClass ¶ added in v0.5.10
func (e *HTMLElement) SetClass(class string)
SetClass sets the class attribute.
func (*HTMLElement) SetID ¶ added in v0.5.10
func (e *HTMLElement) SetID(id string)
SetID sets the id attribute.
func (*HTMLElement) SetInnerHTML ¶ added in v0.5.10
func (e *HTMLElement) SetInnerHTML(html string) error
SetInnerHTML sets the inner HTML by parsing it.
func (*HTMLElement) SetTagName ¶ added in v0.5.10
func (e *HTMLElement) SetTagName(name string)
SetTagName sets the tag name.
func (*HTMLElement) SetTextContent ¶ added in v0.5.10
func (e *HTMLElement) SetTextContent(text string)
SetTextContent sets the text content.
func (*HTMLElement) TagName ¶ added in v0.5.10
func (e *HTMLElement) TagName() string
TagName returns the tag name.
func (*HTMLElement) TextContent ¶ added in v0.5.10
func (e *HTMLElement) TextContent() string
TextContent returns the text content.
func (*HTMLElement) ToBool ¶ added in v0.5.10
func (e *HTMLElement) ToBool() *Bool
ToBool returns true if the element has content.
func (*HTMLElement) ToIndented ¶ added in v0.5.10
func (e *HTMLElement) ToIndented() string
ToIndented converts the element to indented HTML string.
func (*HTMLElement) ToMap ¶ added in v0.5.10
func (e *HTMLElement) ToMap() *Map
ToMap converts the element to a Map.
func (*HTMLElement) ToString ¶ added in v0.5.10
func (e *HTMLElement) ToString() string
ToString converts the element to HTML string.
func (*HTMLElement) ToggleClass ¶ added in v0.5.10
func (e *HTMLElement) ToggleClass(className string)
ToggleClass toggles a class on the element.
func (*HTMLElement) Type ¶ added in v0.5.10
func (e *HTMLElement) Type() ObjectType
Type returns the object type.
func (*HTMLElement) TypeTag ¶ added in v0.5.10
func (e *HTMLElement) TypeTag() TypeTag
TypeTag returns the fast type tag.
type HTMLNodeType ¶ added in v0.5.10
type HTMLNodeType int
HTMLNodeType represents the type of HTML node.
const ( HTMLNodeElement HTMLNodeType = iota HTMLNodeText HTMLNodeComment HTMLNodeDoctype )
type HttpMux ¶ added in v0.4.25
HttpMux wraps http.ServeMux for route registration. It allows scripts to register custom route handlers.
func NewHttpMux ¶ added in v0.4.25
func NewHttpMux() *HttpMux
NewHttpMux creates a new HttpMux object.
func (*HttpMux) HashKey ¶ added in v0.4.25
HashKey returns a hash key for the HTTP mux. HTTP muxes are not hashable in a meaningful way.
func (*HttpMux) Type ¶ added in v0.4.25
func (m *HttpMux) Type() ObjectType
Type returns the object type.
type HttpReq ¶ added in v0.4.25
type HttpReq struct {
// Value is the underlying Go http.Request
Value *http.Request
// Members holds dynamically accessed members for script use
Members map[string]Object
}
HttpReq wraps http.Request for script access. It provides methods and member access for reading HTTP request data.
func NewHttpReq ¶ added in v0.4.25
NewHttpReq creates a new HttpReq object from an http.Request.
func (*HttpReq) HashKey ¶ added in v0.4.25
HashKey returns a hash key for the HTTP request. HTTP requests are not hashable in a meaningful way.
func (*HttpReq) Inspect ¶ added in v0.4.25
Inspect returns a string representation of the HTTP request.
func (*HttpReq) ToBool ¶ added in v0.4.25
ToBool converts the HTTP request to a boolean (always true).
func (*HttpReq) Type ¶ added in v0.4.25
func (r *HttpReq) Type() ObjectType
Type returns the object type.
type HttpResp ¶ added in v0.4.25
type HttpResp struct {
// Value is the underlying Go http.ResponseWriter
Value http.ResponseWriter
// Members holds dynamically accessed members for script use
Members map[string]Object
// contains filtered or unexported fields
}
HttpResp wraps http.ResponseWriter for script access. It provides methods for writing responses and setting headers.
func NewHttpResp ¶ added in v0.4.25
func NewHttpResp(res http.ResponseWriter) *HttpResp
NewHttpResp creates a new HttpResp object from an http.ResponseWriter.
func (*HttpResp) HashKey ¶ added in v0.4.25
HashKey returns a hash key for the HTTP response. HTTP responses are not hashable in a meaningful way.
func (*HttpResp) Inspect ¶ added in v0.4.25
Inspect returns a string representation of the HTTP response.
func (*HttpResp) SetWritten ¶ added in v0.4.25
func (r *HttpResp) SetWritten()
SetWritten marks the response as written.
func (*HttpResp) ToBool ¶ added in v0.4.25
ToBool converts the HTTP response to a boolean (always true).
func (*HttpResp) Type ¶ added in v0.4.25
func (r *HttpResp) Type() ObjectType
Type returns the object type.
type Identifier ¶
type Identifier struct {
Value string
}
Identifier represents an identifier (used in function parameters)
func (*Identifier) String ¶
func (i *Identifier) String() string
type ImageInfo ¶ added in v0.5.2
type ImageInfo struct {
Col, Row int // Top-left position
ColEnd, RowEnd int // Bottom-right position
Filename string // Original filename in xlsx
Data []byte // Image data
}
ImageInfo represents an image in a sheet.
type ImageObj ¶ added in v0.5.13
ImageObj represents an image object in Xxlang
func (*ImageObj) Type ¶ added in v0.5.13
func (i *ImageObj) Type() ObjectType
type Instance ¶
Instance represents an instance of a class
func (*Instance) Type ¶
func (i *Instance) Type() ObjectType
type Int ¶
type Int struct {
Value int64
}
Int represents an integer value
func GetBufferedInt ¶ added in v0.4.23
GetBufferedInt gets a temporary Int using the global buffer
func NewIntSlice ¶ added in v0.4.23
NewIntSlice creates multiple Int objects efficiently This is optimized for batch operations
type IntPoolStats ¶ added in v0.4.23
type IntPoolStats struct {
// CacheHits is the number of times a cached integer was returned
CacheHits int64
// PoolHits is the number of times a pooled integer was reused
PoolHits int64
// PoolMisses is the number of times a new integer had to be allocated
PoolMisses int64
// Created is the number of new integers allocated by the pool
Created int64
// Released is the number of integers returned to the pool
Released int64
}
IntPoolStats tracks statistics about integer pool usage
func GetIntPoolStats ¶ added in v0.4.23
func GetIntPoolStats() IntPoolStats
GetIntPoolStats returns current statistics about integer pool usage
type Lexer ¶ added in v0.5.13
type Lexer struct {
// contains filtered or unexported fields
}
Lexer holds the lexer state
type LineEditor ¶ added in v0.5.8
type LineEditor struct {
// contains filtered or unexported fields
}
LineEditor represents a line-based text editor object. It stores lines in memory and provides various editing operations.
func NewLineEditor ¶ added in v0.5.8
func NewLineEditor() *LineEditor
NewLineEditor creates a new empty LineEditor.
func NewLineEditorFromFile ¶ added in v0.5.8
func NewLineEditorFromFile(path string) (*LineEditor, error)
NewLineEditorFromFile opens a file and creates a LineEditor from its contents.
func NewLineEditorFromLines ¶ added in v0.5.8
func NewLineEditorFromLines(lines []string) *LineEditor
NewLineEditorFromLines creates a LineEditor from a string array.
func NewLineEditorFromText ¶ added in v0.5.8
func NewLineEditorFromText(text string) *LineEditor
NewLineEditorFromText creates a LineEditor from a text string. The text is split by newlines.
func NewLineEditorWithCapacity ¶ added in v0.5.8
func NewLineEditorWithCapacity(capacity int) *LineEditor
NewLineEditorWithCapacity creates a new LineEditor with initial capacity.
func (*LineEditor) AddLine ¶ added in v0.5.8
func (le *LineEditor) AddLine(text string)
AddLine adds a line at the end.
func (*LineEditor) AlignLeft ¶ added in v0.5.8
func (le *LineEditor) AlignLeft(width int)
AlignLeft aligns all lines to the left by trimming and optionally padding.
func (*LineEditor) AlignRight ¶ added in v0.5.8
func (le *LineEditor) AlignRight(width int)
AlignRight aligns all lines to the right by padding.
func (*LineEditor) AppendFromFile ¶ added in v0.5.8
func (le *LineEditor) AppendFromFile(path string) error
AppendFromFile appends lines from a file to the editor.
func (*LineEditor) AppendLines ¶ added in v0.5.8
func (le *LineEditor) AppendLines(newLines []string)
AppendLines appends multiple lines at the end.
func (*LineEditor) AppendToFile ¶ added in v0.5.8
func (le *LineEditor) AppendToFile(path string) error
AppendToFile appends the content to an existing file.
func (*LineEditor) Center ¶ added in v0.5.8
func (le *LineEditor) Center(width int)
Center centers each line within the specified width.
func (*LineEditor) CharCount ¶ added in v0.5.8
func (le *LineEditor) CharCount() int
CharCount returns the total number of bytes in all lines.
func (*LineEditor) Close ¶ added in v0.5.8
func (le *LineEditor) Close()
Close releases resources (no-op for LineEditor).
func (*LineEditor) Comment ¶ added in v0.5.8
func (le *LineEditor) Comment(prefix string)
Comment adds a comment prefix to each line.
func (*LineEditor) CountEmpty ¶ added in v0.5.8
func (le *LineEditor) CountEmpty() int
CountEmpty returns the number of empty lines.
func (*LineEditor) Dedent ¶ added in v0.5.8
func (le *LineEditor) Dedent()
Dedent removes common indentation from all lines.
func (*LineEditor) DeleteLine ¶ added in v0.5.8
func (le *LineEditor) DeleteLine(n int) bool
DeleteLine deletes the line at index n (1-based). Returns false if out of range.
func (*LineEditor) DeleteLines ¶ added in v0.5.8
func (le *LineEditor) DeleteLines(start, end int) bool
DeleteLines deletes lines in the range [start, end] (1-based, inclusive).
func (*LineEditor) DuplicateLine ¶ added in v0.5.8
func (le *LineEditor) DuplicateLine(n int) bool
DuplicateLine duplicates a line at the given index (1-based).
func (*LineEditor) Find ¶ added in v0.5.8
func (le *LineEditor) Find(text string) []int
Find returns line numbers (1-based) containing the text.
func (*LineEditor) FindAll ¶ added in v0.5.8
func (le *LineEditor) FindAll(text string) []string
FindAll returns all lines containing the text.
func (*LineEditor) FindDupes ¶ added in v0.5.8
func (le *LineEditor) FindDupes() map[string]int
FindDupes returns duplicate lines with counts as a map.
func (*LineEditor) FindFirst ¶ added in v0.5.8
func (le *LineEditor) FindFirst(text string) int
FindFirst returns the first line number (1-based) containing the text, or 0 if not found.
func (*LineEditor) FindLast ¶ added in v0.5.8
func (le *LineEditor) FindLast(text string) int
FindLast returns the last line number (1-based) containing the text, or 0 if not found.
func (*LineEditor) FindRegex ¶ added in v0.5.8
func (le *LineEditor) FindRegex(pattern string) ([]int, error)
FindRegex returns line numbers (1-based) matching the pattern.
func (*LineEditor) GetFilePath ¶ added in v0.5.8
func (le *LineEditor) GetFilePath() string
GetFilePath returns the associated file path.
func (*LineEditor) GetLine ¶ added in v0.5.8
func (le *LineEditor) GetLine(n int) (string, bool)
GetLine returns the line at index n (1-based, supports negative index). Returns empty string and false if index is out of range.
func (*LineEditor) GetLines ¶ added in v0.5.8
func (le *LineEditor) GetLines(start, end int) []string
GetLines returns lines in the range [start, end] (1-based, inclusive).
func (*LineEditor) Grep ¶ added in v0.5.8
func (le *LineEditor) Grep(text string) *LineEditor
Grep filters lines containing text and returns a new LineEditor.
func (*LineEditor) GrepNot ¶ added in v0.5.8
func (le *LineEditor) GrepNot(text string) *LineEditor
GrepNot filters lines NOT containing text and returns a new LineEditor.
func (*LineEditor) GrepNotRegex ¶ added in v0.5.8
func (le *LineEditor) GrepNotRegex(pattern string) (*LineEditor, error)
GrepNotRegex filters lines NOT matching pattern and returns a new LineEditor.
func (*LineEditor) GrepRegex ¶ added in v0.5.8
func (le *LineEditor) GrepRegex(pattern string) (*LineEditor, error)
GrepRegex filters lines matching pattern and returns a new LineEditor.
func (*LineEditor) HashKey ¶ added in v0.5.8
func (le *LineEditor) HashKey() HashKey
HashKey returns a hash key for the LineEditor.
func (*LineEditor) Head ¶ added in v0.5.8
func (le *LineEditor) Head(n int) []string
Head returns the first n lines.
func (*LineEditor) Indent ¶ added in v0.5.8
func (le *LineEditor) Indent(prefix string)
Indent adds prefix to each line.
func (*LineEditor) Info ¶ added in v0.5.8
func (le *LineEditor) Info() map[string]int
Info returns a map with statistics about the editor content.
func (*LineEditor) InsertLine ¶ added in v0.5.8
func (le *LineEditor) InsertLine(n int, text string) bool
InsertLine inserts a line before index n (1-based). Returns false if out of range.
func (*LineEditor) Inspect ¶ added in v0.5.8
func (le *LineEditor) Inspect() string
Inspect returns a string representation of the LineEditor.
func (*LineEditor) IsEmpty ¶ added in v0.5.8
func (le *LineEditor) IsEmpty() bool
IsEmpty checks if the editor is empty.
func (*LineEditor) IsModified ¶ added in v0.5.8
func (le *LineEditor) IsModified() bool
IsModified checks if the content has been modified.
func (*LineEditor) Join ¶ added in v0.5.8
func (le *LineEditor) Join(sep string) string
Join joins all lines into one with separator.
func (*LineEditor) KeepDupes ¶ added in v0.5.8
func (le *LineEditor) KeepDupes()
KeepDupes keeps only duplicate lines (removes unique lines).
func (*LineEditor) LineCount ¶ added in v0.5.8
func (le *LineEditor) LineCount() int
LineCount returns the number of lines.
func (*LineEditor) MoveLine ¶ added in v0.5.8
func (le *LineEditor) MoveLine(from, to int) bool
MoveLine moves a line from one position to another (1-based).
func (*LineEditor) NumberLines ¶ added in v0.5.8
func (le *LineEditor) NumberLines(start int)
NumberLines adds line number prefix to each line.
func (*LineEditor) PadLeft ¶ added in v0.5.8
func (le *LineEditor) PadLeft(width int, padChar string)
PadLeft pads each line on the left to the specified width with the given character.
func (*LineEditor) PadRight ¶ added in v0.5.8
func (le *LineEditor) PadRight(width int, padChar string)
PadRight pads each line to the specified width with the given character.
func (*LineEditor) Prefix ¶ added in v0.5.8
func (le *LineEditor) Prefix(prefix string)
Prefix adds prefix to each line.
func (*LineEditor) RemoveBlank ¶ added in v0.5.8
func (le *LineEditor) RemoveBlank()
RemoveBlank removes blank lines (whitespace only).
func (*LineEditor) RemoveDupes ¶ added in v0.5.8
func (le *LineEditor) RemoveDupes()
RemoveDupes removes all duplicate lines (keeps only unique lines).
func (*LineEditor) RemoveEmpty ¶ added in v0.5.8
func (le *LineEditor) RemoveEmpty()
RemoveEmpty removes empty lines.
func (*LineEditor) Replace ¶ added in v0.5.8
func (le *LineEditor) Replace(old, new string) int
Replace replaces all occurrences of old text with new text in all lines. Returns the number of replacements made.
func (*LineEditor) ReplaceFirst ¶ added in v0.5.8
func (le *LineEditor) ReplaceFirst(old, new string) bool
ReplaceFirst replaces the first occurrence globally.
func (*LineEditor) ReplaceLast ¶ added in v0.5.8
func (le *LineEditor) ReplaceLast(old, new string) bool
ReplaceLast replaces the last occurrence globally.
func (*LineEditor) ReplaceLine ¶ added in v0.5.8
func (le *LineEditor) ReplaceLine(n int, old, new string) int
ReplaceLine replaces only in the specified line (1-based).
func (*LineEditor) ReplaceRange ¶ added in v0.5.8
func (le *LineEditor) ReplaceRange(start, end int, old, new string) int
ReplaceRange replaces within the specified line range [start, end] (1-based).
func (*LineEditor) ReplaceRegex ¶ added in v0.5.8
func (le *LineEditor) ReplaceRegex(pattern, new string) (int, error)
ReplaceRegex replaces all matches of pattern with new text.
func (*LineEditor) Reverse ¶ added in v0.5.8
func (le *LineEditor) Reverse()
Reverse reverses the line order.
func (*LineEditor) RuneCount ¶ added in v0.5.8
func (le *LineEditor) RuneCount() int
RuneCount returns the total number of runes (Unicode code points) in all lines.
func (*LineEditor) Sample ¶ added in v0.5.8
func (le *LineEditor) Sample(n int) *LineEditor
Sample returns a new LineEditor with n randomly selected lines.
func (*LineEditor) Save ¶ added in v0.5.8
func (le *LineEditor) Save() error
Save saves to the original file.
func (*LineEditor) SaveAs ¶ added in v0.5.8
func (le *LineEditor) SaveAs(path string) error
SaveAs saves to a new file.
func (*LineEditor) SelectLines ¶ added in v0.5.8
func (le *LineEditor) SelectLines(indices []int) *LineEditor
SelectLines returns a new LineEditor with only the lines at specified indices.
func (*LineEditor) SetFilePath ¶ added in v0.5.8
func (le *LineEditor) SetFilePath(path string)
SetFilePath sets the associated file path.
func (*LineEditor) SetLine ¶ added in v0.5.8
func (le *LineEditor) SetLine(n int, text string) bool
SetLine sets the line at index n (1-based). Returns false if out of range.
func (*LineEditor) SetLines ¶ added in v0.5.8
func (le *LineEditor) SetLines(start int, newLines []string) bool
SetLines replaces lines in the range starting from start (1-based).
func (*LineEditor) Shuffle ¶ added in v0.5.8
func (le *LineEditor) Shuffle()
Shuffle randomizes the line order.
func (*LineEditor) Sort ¶ added in v0.5.8
func (le *LineEditor) Sort()
Sort sorts lines alphabetically (ascending).
func (*LineEditor) SortByCol ¶ added in v0.5.8
func (le *LineEditor) SortByCol(col int, sep string)
SortByCol sorts by specified column (1-based).
func (*LineEditor) SortByColNum ¶ added in v0.5.8
func (le *LineEditor) SortByColNum(col int, sep string)
SortByColNum sorts by specified column numerically (1-based).
func (*LineEditor) SortDesc ¶ added in v0.5.8
func (le *LineEditor) SortDesc()
SortDesc sorts lines alphabetically (descending).
func (*LineEditor) SortNum ¶ added in v0.5.8
func (le *LineEditor) SortNum()
SortNum sorts lines numerically (ascending). Non-numeric lines are placed at the end.
func (*LineEditor) SortNumDesc ¶ added in v0.5.8
func (le *LineEditor) SortNumDesc()
SortNumDesc sorts lines numerically (descending).
func (*LineEditor) SplitLines ¶ added in v0.5.8
func (le *LineEditor) SplitLines(sep string)
SplitLines splits each line by separator into multiple lines.
func (*LineEditor) StripPrefix ¶ added in v0.5.8
func (le *LineEditor) StripPrefix(prefix string)
StripPrefix removes a prefix from each line if present.
func (*LineEditor) StripSuffix ¶ added in v0.5.8
func (le *LineEditor) StripSuffix(suffix string)
StripSuffix removes a suffix from each line if present.
func (*LineEditor) Suffix ¶ added in v0.5.8
func (le *LineEditor) Suffix(suffix string)
Suffix adds suffix to each line.
func (*LineEditor) SwapLines ¶ added in v0.5.8
func (le *LineEditor) SwapLines(n1, n2 int) bool
SwapLines swaps two lines at the given indices (1-based).
func (*LineEditor) Tail ¶ added in v0.5.8
func (le *LineEditor) Tail(n int) []string
Tail returns the last n lines.
func (*LineEditor) TakeLines ¶ added in v0.5.8
func (le *LineEditor) TakeLines(start, end int) []string
TakeLines extracts and removes a range of lines, returning them.
func (*LineEditor) ToBool ¶ added in v0.5.8
func (le *LineEditor) ToBool() *Bool
ToBool returns true (LineEditor is always truthy).
func (*LineEditor) ToLines ¶ added in v0.5.8
func (le *LineEditor) ToLines() []string
ToLines returns the line array.
func (*LineEditor) ToLowerCase ¶ added in v0.5.8
func (le *LineEditor) ToLowerCase()
ToLowerCase converts all lines to lowercase.
func (*LineEditor) ToText ¶ added in v0.5.8
func (le *LineEditor) ToText() string
ToText returns the full text with newlines.
func (*LineEditor) ToUpperCase ¶ added in v0.5.8
func (le *LineEditor) ToUpperCase()
ToUpperCase converts all lines to uppercase.
func (*LineEditor) Trim ¶ added in v0.5.8
func (le *LineEditor) Trim()
Trim trims whitespace from each line.
func (*LineEditor) TrimLeft ¶ added in v0.5.8
func (le *LineEditor) TrimLeft()
TrimLeft trims leading whitespace from each line.
func (*LineEditor) TrimRight ¶ added in v0.5.8
func (le *LineEditor) TrimRight()
TrimRight trims trailing whitespace from each line.
func (*LineEditor) Truncate ¶ added in v0.5.8
func (le *LineEditor) Truncate(maxLen int)
Truncate truncates each line to the specified maximum length.
func (*LineEditor) TruncateWithEllipsis ¶ added in v0.5.8
func (le *LineEditor) TruncateWithEllipsis(maxLen int)
TruncateWithEllipsis truncates each line and adds "..." if truncated.
func (*LineEditor) Type ¶ added in v0.5.8
func (le *LineEditor) Type() ObjectType
Type returns the object type.
func (*LineEditor) TypeTag ¶ added in v0.5.8
func (le *LineEditor) TypeTag() TypeTag
TypeTag returns the fast type tag.
func (*LineEditor) Uncomment ¶ added in v0.5.8
func (le *LineEditor) Uncomment(prefix string)
Uncomment removes a comment prefix from each line.
func (*LineEditor) Unique ¶ added in v0.5.8
func (le *LineEditor) Unique()
Unique removes duplicate lines (keeps first occurrence).
func (*LineEditor) UniqueSorted ¶ added in v0.5.8
func (le *LineEditor) UniqueSorted()
UniqueSorted sorts then removes duplicates.
func (*LineEditor) ViewAll ¶ added in v0.5.8
func (le *LineEditor) ViewAll(showNumber bool) []string
ViewAll returns all lines formatted (with optional line numbers).
func (*LineEditor) ViewLine ¶ added in v0.5.8
func (le *LineEditor) ViewLine(n int, showNumber bool) string
ViewLine returns a formatted string for the specified line (with line number).
func (*LineEditor) ViewLines ¶ added in v0.5.8
func (le *LineEditor) ViewLines(start, end int, showNumber bool) []string
ViewLines returns formatted strings for a range of lines.
func (*LineEditor) WordCount ¶ added in v0.5.8
func (le *LineEditor) WordCount() int
WordCount returns the total number of words in all lines.
type MailClient ¶ added in v0.5.13
type MailClient struct {
Host string
Port int
User string
Password string
From string
FromName string
UseTLS bool
}
MailClient represents an email client configuration
func (*MailClient) HashKey ¶ added in v0.5.13
func (m *MailClient) HashKey() HashKey
HashKey returns a hash key
func (*MailClient) Inspect ¶ added in v0.5.13
func (m *MailClient) Inspect() string
Inspect returns a string representation
func (*MailClient) ToBool ¶ added in v0.5.13
func (m *MailClient) ToBool() *Bool
ToBool returns true
func (*MailClient) Type ¶ added in v0.5.13
func (m *MailClient) Type() ObjectType
Type returns the object type
func (*MailClient) TypeTag ¶ added in v0.5.13
func (m *MailClient) TypeTag() TypeTag
TypeTag returns the type tag
type Map ¶
Map represents a map value
func DeepMergeYAMLMaps ¶ added in v0.5.10
DeepMergeYAMLMaps performs a deep merge of YAML maps
func MergeYAMLMaps ¶ added in v0.5.10
MergeYAMLMaps merges multiple YAML maps
func NewMapWithCapacity ¶ added in v0.4.23
NewMapWithCapacity creates a new Map with pre-allocated capacity
func (*Map) GetSortedKeys ¶ added in v0.4.23
GetSortedKeys returns the keys in sorted order, caching the result
func (*Map) InvalidateKeysCache ¶ added in v0.4.23
func (m *Map) InvalidateKeysCache()
InvalidateKeysCache marks the sorted keys cache as invalid Call this when the map is modified
type MapPair ¶
MapPair represents a key-value pair in a map
func ParseYAMLPairs ¶ added in v0.5.10
ParseYAMLPairs parses key-value pairs from a YAML mapping
type MapPoolStats ¶ added in v0.4.23
MapPoolStats tracks statistics about map pool usage
func GetMapPoolStats ¶ added in v0.4.23
func GetMapPoolStats() MapPoolStats
GetMapPoolStats returns current statistics about map pool usage
type MergeRange ¶ added in v0.5.2
MergeRange represents merged cells.
type Module ¶
type Module struct {
// Name is the module's identifier (typically the file path)
Name string
// Exports maps exported symbol names to their values
Exports map[string]Object
// Globals holds the module's global variables state.
// This is needed so exported functions can access module-level variables.
Globals []Object
}
Module represents a loaded module with its exported symbols. Modules are created when a source file is imported and compiled, and they hold all exported values accessible to importers.
func (*Module) HashKey ¶
HashKey returns a hash key for the module. Modules are not hashable in a meaningful way, so we return a constant.
type Mutex ¶ added in v0.4.25
type Mutex struct {
// contains filtered or unexported fields
}
Mutex wraps sync.Mutex for use in Xxlang
func (*Mutex) Lock ¶ added in v0.4.25
func (m *Mutex) Lock()
Lock acquires the mutex, blocking if necessary
func (*Mutex) TryLock ¶ added in v0.4.25
TryLock attempts to acquire the mutex without blocking Returns true if successful, false otherwise
func (*Mutex) Type ¶ added in v0.4.25
func (m *Mutex) Type() ObjectType
Object interface implementation
type Null ¶
type Null struct{}
Null represents the null value
func (*Null) Type ¶
func (n *Null) Type() ObjectType
type Object ¶
type Object interface {
Type() ObjectType
TypeTag() TypeTag // Fast type check without string comparison
Inspect() string
ToBool() *Bool
HashKey() HashKey
}
Object is the base interface for all values in Xxlang
func CallUserFunc ¶ added in v0.4.25
CallUserFunc calls a user-defined function from within a builtin method Returns an error if the callback is not set or if the call fails
func GoValueToObject ¶ added in v0.4.25
func GoValueToObject(v interface{}) Object
GoValueToObject converts a Go value (from JSON unmarshaling) to an Xxlang Object. This function is exported for use by other packages that need to convert Go values to Xxlang objects.
func InterfaceToObject ¶ added in v0.5.13
func InterfaceToObject(v interface{}) Object
InterfaceToObject converts Go interface{} to Object (exported for crypto module)
func IoCopy ¶ added in v0.4.25
IoCopy copies data from reader to writer. This is exposed as a builtin function.
func JSONToObject ¶ added in v0.4.25
JSONToObject parses a JSON string and returns an Xxlang Object. This is the primary function for JSON deserialization in Xxlang.
func ParseYAML ¶ added in v0.5.10
ParseYAML parses a YAML string and returns an Xxlang Object. This is the main entry point for YAML parsing.
func ParseYAMLDocuments ¶ added in v0.5.10
ParseYAMLDocuments parses a YAML string with multiple documents.
func RowsToArrays ¶ added in v0.4.36
RowsToArrays converts sql.Rows to an array of arrays. Each row is an array of values in column order.
func RowsToMaps ¶ added in v0.4.36
RowsToMaps converts sql.Rows to an array of maps. Each row is a map with column names as keys.
func Scan ¶ added in v0.4.25
Scan reads a line from stdin and returns it as a string. If a prompt string is provided, it is printed first.
func Scanf ¶ added in v0.4.25
Scanf reads input according to a format string. The format string can contain {} placeholders for values. Returns an array of parsed values.
func YAMLPathQuery ¶ added in v0.5.10
YAMLPathQuery queries a YAML object using a simple path syntax
type ObjectToJSONOptions ¶ added in v0.4.25
ObjectToJSONOptions contains options for JSON serialization
type ObjectType ¶
type ObjectType string
ObjectType represents the type of an object
const ( NullType ObjectType = "NULL" IntType ObjectType = "INT" FloatType ObjectType = "FLOAT" StringType ObjectType = "STRING" CharsType ObjectType = "CHARS" BoolType ObjectType = "BOOL" ArrayType ObjectType = "ARRAY" MapType ObjectType = "MAP" FunctionType ObjectType = "FUNCTION" BuiltinType ObjectType = "BUILTIN" BytesType ObjectType = "BYTES" ClassType ObjectType = "CLASS" InstanceType ObjectType = "INSTANCE" ErrorType ObjectType = "ERROR" ReturnType ObjectType = "RETURN" ClosureType ObjectType = "CLOSURE" ModuleType ObjectType = "MODULE" StringBuilderType ObjectType = "STRING_BUILDER" BytesBufferType ObjectType = "BYTES_BUFFER" BigIntType ObjectType = "BIGINT" BigFloatType ObjectType = "BIGFLOAT" HttpReqType ObjectType = "HTTP_REQ" HttpRespType ObjectType = "HTTP_RESP" HttpMuxType ObjectType = "HTTP_MUX" WebSocketType ObjectType = "WEBSOCKET" TubeType ObjectType = "TUBE" MutexType ObjectType = "MUTEX" RWMutexType ObjectType = "RWMUTEX" WaitGroupType ObjectType = "WAITGROUP" OnceType ObjectType = "ONCE" CondType ObjectType = "COND" AtomicIntType ObjectType = "ATOMICINT" GoroutineType ObjectType = "GOROUTINE" ContextType ObjectType = "CONTEXT" FileUploadType ObjectType = "FILE_UPLOAD" FileUploadResultType ObjectType = "FILE_UPLOAD_RESULT" FileType ObjectType = "FILE" FileInfoType ObjectType = "FILE_INFO" ReaderType ObjectType = "READER" WriterType ObjectType = "WRITER" ScannerType ObjectType = "SCANNER" DBType ObjectType = "DB" DBTxType ObjectType = "DB_TX" DBRowsType ObjectType = "DB_ROWS" DBStmtType ObjectType = "DB_STMT" OrderedMapType ObjectType = "ORDERED_MAP" QueueType ObjectType = "QUEUE" SetType ObjectType = "SET" XLSXType ObjectType = "XLSX" XMLDocumentType ObjectType = "XML_DOCUMENT" XMLNodeType ObjectType = "XML_NODE" DocxDocumentType ObjectType = "DOCX_DOCUMENT" DocxParagraphType ObjectType = "DOCX_PARAGRAPH" DocxRunType ObjectType = "DOCX_RUN" DocxTableType ObjectType = "DOCX_TABLE" DocxTableRowType ObjectType = "DOCX_TABLE_ROW" DocxTableCellType ObjectType = "DOCX_TABLE_CELL" DocxImageType ObjectType = "DOCX_IMAGE" DocxSectionType ObjectType = "DOCX_SECTION" DocxHeaderType ObjectType = "DOCX_HEADER" DocxStyleType ObjectType = "DOCX_STYLE" DocxHyperlinkType ObjectType = "DOCX_HYPERLINK" DocxBookmarkType ObjectType = "DOCX_BOOKMARK" DocxTOCType ObjectType = "DOCX_TOC" DocxTextBoxType ObjectType = "DOCX_TEXT_BOX" DocxShapeType ObjectType = "DOCX_SHAPE" DocxChartType ObjectType = "DOCX_CHART" DocxCommentType ObjectType = "DOCX_COMMENT" DocxRevisionType ObjectType = "DOCX_REVISION" DocxFootnoteType ObjectType = "DOCX_FOOTNOTE" DocxEndnoteType ObjectType = "DOCX_ENDNOTE" // PPTX types PPTXDocumentType ObjectType = "PPTX_DOCUMENT" PPTXSlideType ObjectType = "PPTX_SLIDE" PPTXTextFrameType ObjectType = "PPTX_TEXT_FRAME" PPTXParagraphType ObjectType = "PPTX_PARAGRAPH" PPTXTextRunType ObjectType = "PPTX_TEXT_RUN" PPTXShapeType ObjectType = "PPTX_SHAPE" PPTXTableType ObjectType = "PPTX_TABLE" PPTXTableCellType ObjectType = "PPTX_TABLE_CELL" PPTXChartType ObjectType = "PPTX_CHART" PPTXChartSeriesType ObjectType = "PPTX_CHART_SERIES" PPTXImageType ObjectType = "PPTX_IMAGE" PPTXVideoType ObjectType = "PPTX_VIDEO" PPTXAudioType ObjectType = "PPTX_AUDIO" PPTXSlideLayoutType ObjectType = "PPTX_SLIDE_LAYOUT" PPTXSlideMasterType ObjectType = "PPTX_SLIDE_MASTER" PPTXThemeType ObjectType = "PPTX_THEME" // PDF types PDFType ObjectType = "PDF" PDFDocumentType ObjectType = "PDF_DOCUMENT" PDFPageType ObjectType = "PDF_PAGE" PDFInfoType ObjectType = "PDF_INFO" // Socket types SocketAddrType ObjectType = "SOCKET_ADDR" TcpServerType ObjectType = "TCP_SERVER" TcpClientType ObjectType = "TCP_CLIENT" UdpSocketType ObjectType = "UDP_SOCKET" // LineEditor type LineEditorType ObjectType = "LINE_EDITOR" // SSH types SSHClientType ObjectType = "SSH_CLIENT" // FTP/SFTP types FtpClientType ObjectType = "FTP_CLIENT" FtpServerType ObjectType = "FTP_SERVER" SftpClientType ObjectType = "SFTP_CLIENT" SftpServerType ObjectType = "SFTP_SERVER" // HTML types HTMLDocumentType ObjectType = "HTML_DOCUMENT" HTMLElementType ObjectType = "HTML_ELEMENT" // YAML types YAMLDocumentType ObjectType = "YAML_DOCUMENT" // TOML types TomlDocumentType ObjectType = "TOML_DOCUMENT" // Time type TimeType ObjectType = "TIME" )
Object types
const CompiledFunctionType ObjectType = "COMPILED_FUNCTION"
CompiledFunctionType is the type for compiled functions
const WebViewType ObjectType = "WEBVIEW"
WebViewType is the object type for WebView.
type Once ¶ added in v0.4.25
type Once struct {
// contains filtered or unexported fields
}
Once wraps sync.Once for use in Xxlang
func (*Once) Type ¶ added in v0.4.25
func (o *Once) Type() ObjectType
Object interface implementation
type OrderedMap ¶ added in v0.5.6
type OrderedMap struct {
Pairs map[HashKey]int // HashKey -> index in orderSlice
// contains filtered or unexported fields
}
OrderedMap represents a map that preserves insertion order of key-value pairs. It supports O(1) lookup via a hash map and ordered iteration via a slice.
func AcquireOrderedMap ¶ added in v0.5.6
func AcquireOrderedMap() *OrderedMap
AcquireOrderedMap gets an OrderedMap from the pool
func NewOrderedMap ¶ added in v0.5.6
func NewOrderedMap() *OrderedMap
NewOrderedMap creates a new empty OrderedMap
func NewOrderedMapWithCapacity ¶ added in v0.5.6
func NewOrderedMapWithCapacity(capacity int) *OrderedMap
NewOrderedMapWithCapacity creates a new OrderedMap with pre-allocated capacity
func YAMLOMap ¶ added in v0.5.10
func YAMLOMap(pairs []MapPair) *OrderedMap
YAMLOMap creates an ordered map from key-value pairs
func (*OrderedMap) Clone ¶ added in v0.5.6
func (om *OrderedMap) Clone() *OrderedMap
Clone creates a deep copy of the OrderedMap
func (*OrderedMap) Delete ¶ added in v0.5.6
func (om *OrderedMap) Delete(key Object) bool
Delete removes a key-value pair. Returns true if the key was found and removed.
func (*OrderedMap) Get ¶ added in v0.5.6
func (om *OrderedMap) Get(key Object) Object
Get retrieves a value by key. Returns NULL if key not found.
func (*OrderedMap) GetAt ¶ added in v0.5.6
func (om *OrderedMap) GetAt(index int) (Object, Object, error)
GetAt returns the key-value pair at a specific index. Returns nil, nil, error if index is out of bounds.
func (*OrderedMap) GetIndex ¶ added in v0.5.6
func (om *OrderedMap) GetIndex(key Object) int
GetIndex returns the index of a key (0-based). Returns -1 if key not found.
func (*OrderedMap) GetOrderedKeys ¶ added in v0.5.6
func (om *OrderedMap) GetOrderedKeys() []Object
GetOrderedKeys returns keys in insertion order
func (*OrderedMap) GetOrderedPairs ¶ added in v0.5.6
func (om *OrderedMap) GetOrderedPairs() []Object
GetOrderedPairs returns key-value pairs as array of [key, value] arrays
func (*OrderedMap) GetOrderedValues ¶ added in v0.5.6
func (om *OrderedMap) GetOrderedValues() []Object
GetOrderedValues returns values in insertion order
func (*OrderedMap) HasKey ¶ added in v0.5.6
func (om *OrderedMap) HasKey(key Object) bool
HasKey checks if a key exists
func (*OrderedMap) HashKey ¶ added in v0.5.6
func (om *OrderedMap) HashKey() HashKey
HashKey returns an empty HashKey (OrderedMaps are not hashable)
func (*OrderedMap) InsertAt ¶ added in v0.5.6
func (om *OrderedMap) InsertAt(key Object, value Object, index int) error
InsertAt inserts a key-value pair at a specific index. If the key already exists, it updates the value and moves it to the new position. Returns error if index is out of bounds.
func (*OrderedMap) Inspect ¶ added in v0.5.6
func (om *OrderedMap) Inspect() string
Inspect returns a string representation of the OrderedMap
func (*OrderedMap) Len ¶ added in v0.5.6
func (om *OrderedMap) Len() int
Len returns the number of key-value pairs
func (*OrderedMap) MoveAfter ¶ added in v0.5.6
func (om *OrderedMap) MoveAfter(key1, key2 Object) error
MoveAfter moves key1 to the position immediately after key2. Returns error if either key is not found.
func (*OrderedMap) MoveBefore ¶ added in v0.5.6
func (om *OrderedMap) MoveBefore(key1, key2 Object) error
MoveBefore moves key1 to the position immediately before key2. Returns error if either key is not found.
func (*OrderedMap) MoveToBack ¶ added in v0.5.6
func (om *OrderedMap) MoveToBack(key Object) error
MoveToBack moves a key to the back (last position). Returns error if key not found.
func (*OrderedMap) MoveToFront ¶ added in v0.5.6
func (om *OrderedMap) MoveToFront(key Object) error
MoveToFront moves a key to the front (position 0). Returns error if key not found.
func (*OrderedMap) Reverse ¶ added in v0.5.6
func (om *OrderedMap) Reverse()
Reverse reverses the order of all elements
func (*OrderedMap) Set ¶ added in v0.5.6
func (om *OrderedMap) Set(key Object, value Object)
Set adds or updates a key-value pair. If the key exists, it updates the value but preserves the position. If the key is new, it appends to the end.
func (*OrderedMap) SetAt ¶ added in v0.5.6
func (om *OrderedMap) SetAt(index int, value Object) error
SetAt updates the value at a specific index. Returns error if index is out of bounds.
func (*OrderedMap) SortByKey ¶ added in v0.5.6
func (om *OrderedMap) SortByKey()
SortByKey sorts the map by key (alphabetically by string representation)
func (*OrderedMap) Swap ¶ added in v0.5.6
func (om *OrderedMap) Swap(key1, key2 Object) error
Swap swaps the positions of two keys. Returns error if either key is not found.
func (*OrderedMap) ToBool ¶ added in v0.5.6
func (om *OrderedMap) ToBool() *Bool
ToBool returns TRUE if the map has elements, FALSE otherwise
func (*OrderedMap) ToMap ¶ added in v0.5.6
func (om *OrderedMap) ToMap() *Map
ToMap converts the OrderedMap to a regular Map
func (*OrderedMap) Type ¶ added in v0.5.6
func (om *OrderedMap) Type() ObjectType
Type returns the object type
func (*OrderedMap) TypeTag ¶ added in v0.5.6
func (om *OrderedMap) TypeTag() TypeTag
TypeTag returns the type tag for fast type checking
type OrderedMapPair ¶ added in v0.5.6
OrderedMapPair represents a key-value pair in an OrderedMap
type PDF ¶ added in v0.5.7
type PDF struct {
// Source information
FilePath string // Original file path (may be empty if from bytes)
Source []byte // Raw PDF data
Modified time.Time // Last modification time
// Parsed structure
Version string // PDF version (e.g., "1.4")
Objects map[int64]*PDFObj // Parsed PDF objects by object number
XRefTable *PDFXRefTable // Cross-reference table
Trailer *PDFDict // Trailer dictionary
RootObj int64 // Root object number (Catalog)
InfoObj int64 // Info object number (metadata)
PageCount int // Number of pages
Pages []*PDFPage // Cached page objects
// State
IsOpen bool // Whether the PDF is currently open
IsModified bool // Whether modifications have been made
// contains filtered or unexported fields
}
PDF represents an opened PDF file for reading and manipulation. It holds the parsed PDF structure and provides methods for extracting text, getting page info, and performing operations.
func NewPDFFromBytes ¶ added in v0.5.7
NewPDFFromBytes creates a PDF object from byte data.
func NewPDFFromFile ¶ added in v0.5.7
NewPDFFromFile creates a PDF object from a file path.
func (*PDF) ExtractAllText ¶ added in v0.5.7
ExtractAllText extracts text from all pages.
func (*PDF) ExtractText ¶ added in v0.5.7
ExtractText extracts text from a specific page.
func (*PDF) RotatePage ¶ added in v0.5.7
RotatePage rotates a page by the specified angle.
type PDFArray ¶ added in v0.5.7
type PDFArray struct {
Elements []interface{}
}
PDFArray represents a PDF array object.
type PDFDict ¶ added in v0.5.7
type PDFDict struct {
Entries map[string]interface{}
}
PDFDict represents a PDF dictionary object.
type PDFDocument ¶ added in v0.5.7
type PDFDocument struct {
// Document properties
Version string // PDF version (default "1.4")
Title string
Author string
Subject string
Creator string
Producer string
// Pages
Pages []*PDFPageData // Page data for new document
// Object tracking
NextObjNum int64 // Next object number to assign
Objects []interface{} // Objects to write
// Font settings
DefaultFont string // Default font name
FontSize float64 // Default font size
// contains filtered or unexported fields
}
PDFDocument represents a new PDF document being created. Use this to create PDFs from scratch with text and pages.
func NewPDFDocument ¶ added in v0.5.7
func NewPDFDocument() *PDFDocument
NewPDFDocument creates a new PDF document.
func (*PDFDocument) AddPage ¶ added in v0.5.7
func (d *PDFDocument) AddPage(width, height float64) Object
AddPage adds a new page to the document.
func (*PDFDocument) GetMember ¶ added in v0.5.7
func (d *PDFDocument) GetMember(name string) Object
GetMember returns a member by name for script access.
func (*PDFDocument) HashKey ¶ added in v0.5.7
func (d *PDFDocument) HashKey() HashKey
HashKey returns a hash key.
func (*PDFDocument) Inspect ¶ added in v0.5.7
func (d *PDFDocument) Inspect() string
Inspect returns a string representation.
func (*PDFDocument) Save ¶ added in v0.5.7
func (d *PDFDocument) Save(filePath string) Object
Save saves the document to a file.
func (*PDFDocument) SetFont ¶ added in v0.5.7
func (d *PDFDocument) SetFont(name string, size float64) Object
SetFont sets the default font and size.
func (*PDFDocument) ToBool ¶ added in v0.5.7
func (d *PDFDocument) ToBool() *Bool
ToBool always returns true.
func (*PDFDocument) ToBytes ¶ added in v0.5.7
func (d *PDFDocument) ToBytes() Object
ToBytes returns the document as a byte array.
func (*PDFDocument) Type ¶ added in v0.5.7
func (d *PDFDocument) Type() ObjectType
Type returns the object type.
func (*PDFDocument) TypeTag ¶ added in v0.5.7
func (d *PDFDocument) TypeTag() TypeTag
TypeTag returns the type tag for fast type checking.
type PDFHexStr ¶ added in v0.5.7
type PDFHexStr string
PDFHexStr represents a PDF hexadecimal string.
type PDFInfo ¶ added in v0.5.7
type PDFInfo struct {
Title string
Author string
Subject string
Keywords string
Creator string
Producer string
CreationDate string
ModDate string
PageCount int
Version string
Encrypted bool
FileSize int64
}
PDFInfo contains metadata information about a PDF document.
func (*PDFInfo) Type ¶ added in v0.5.7
func (i *PDFInfo) Type() ObjectType
Type returns the object type.
type PDFObj ¶ added in v0.5.7
type PDFObj struct {
Number int64 // Object number
Generation int64 // Generation number
Value interface{} // The actual value (PDFDict, PDFArray, PDFStream, etc.)
Offset int64 // Byte offset in file (for reference)
}
PDFObj represents a parsed PDF object.
type PDFPage ¶ added in v0.5.7
type PDFPage struct {
// Parent reference
PDF *PDF // Reference to parent PDF
PageNum int // Page number (0-indexed)
// Page properties from PDF
Width float64 // Page width in points
Height float64 // Page height in points
Rotation int // Page rotation (0, 90, 180, 270)
MediaBox *PDFArray // MediaBox array
CropBox *PDFArray // CropBox array (optional)
Contents []int64 // Content stream object numbers
Resources *PDFDict // Page resources dictionary
// Cached content
Text string // Cached extracted text
Parsed bool // Whether content has been parsed
// contains filtered or unexported fields
}
PDFPage represents a page in an existing PDF document. It provides methods for extracting content and getting page properties.
func (*PDFPage) ExtractText ¶ added in v0.5.7
ExtractText extracts text from the page.
func (*PDFPage) Type ¶ added in v0.5.7
func (pg *PDFPage) Type() ObjectType
Type returns the object type.
type PDFPageData ¶ added in v0.5.7
type PDFPageData struct {
Width float64
Height float64
Contents *strings.Builder // Content stream
Resources map[string]interface{}
Rotation int
}
PDFPageData represents a page in a PDFDocument being created.
type PDFXRefEntry ¶ added in v0.5.7
type PDFXRefEntry struct {
Type int // 0 = free, 1 = in-use, 2 = compressed
Offset int64 // Byte offset (type 1) or object stream number (type 2)
Generation int64 // Generation number
Index int // Index within object stream (type 2 only)
}
PDFXRefEntry represents an entry in the cross-reference table.
type PDFXRefTable ¶ added in v0.5.7
type PDFXRefTable struct {
Entries map[int64]*PDFXRefEntry
}
PDFXRefTable represents the cross-reference table.
type PPTXAudio ¶ added in v0.5.6
type PPTXAudio struct {
// contains filtered or unexported fields
}
PPTXAudio represents an audio on a slide.
func (*PPTXAudio) GetPosition ¶ added in v0.5.6
func (a *PPTXAudio) GetPosition() PPTXPosition
GetPosition returns the position.
func (*PPTXAudio) SetPosition ¶ added in v0.5.6
SetPosition sets the position.
func (*PPTXAudio) Type ¶ added in v0.5.6
func (a *PPTXAudio) Type() ObjectType
Type implementations for PPTXAudio
type PPTXBulletStyle ¶ added in v0.5.6
type PPTXBulletStyle struct {
Type string // "bullet", "numbered", "none"
Char string // bullet character
StartAt int // starting number for numbered lists
Font PPTXFont
Color PPTXColor
}
PPTXBulletStyle represents bullet/numbering style.
type PPTXCellStyle ¶ added in v0.5.6
type PPTXCellStyle struct {
Fill *PPTXColor
BorderColor *PPTXColor
BorderWidth int64
Font PPTXFont
Alignment string
Vertical string
}
PPTXCellStyle represents table cell styling.
type PPTXChart ¶ added in v0.5.6
type PPTXChart struct {
// contains filtered or unexported fields
}
PPTXChart represents a chart on a slide.
func (*PPTXChart) GetKind ¶ added in v0.5.6
func (c *PPTXChart) GetKind() PPTXChartKind
GetKind returns the chart kind.
func (*PPTXChart) GetPosition ¶ added in v0.5.6
func (c *PPTXChart) GetPosition() PPTXPosition
GetPosition returns the position.
func (*PPTXChart) GetSeries ¶ added in v0.5.6
func (c *PPTXChart) GetSeries() []*PPTXChartSeries
GetSeries returns all series.
func (*PPTXChart) GetSeriesCount ¶ added in v0.5.6
GetSeriesCount returns the number of series.
func (*PPTXChart) SetPosition ¶ added in v0.5.6
SetPosition sets the position.
func (*PPTXChart) Type ¶ added in v0.5.6
func (c *PPTXChart) Type() ObjectType
Type implementations for PPTXChart
type PPTXChartData ¶ added in v0.5.6
type PPTXChartData struct {
// contains filtered or unexported fields
}
PPTXChartData represents chart data.
type PPTXChartKind ¶ added in v0.5.6
type PPTXChartKind string
PPTXChartKind defines chart types.
const ( PPTXChartBar PPTXChartKind = "bar" PPTXChartBarStacked PPTXChartKind = "barStacked" PPTXChartColumn PPTXChartKind = "column" PPTXChartLine PPTXChartKind = "line" PPTXChartPie PPTXChartKind = "pie" PPTXChartArea PPTXChartKind = "area" PPTXChartScatter PPTXChartKind = "scatter" PPTXChartRadar PPTXChartKind = "radar" PPTXChartCombo PPTXChartKind = "combo" )
type PPTXChartSeries ¶ added in v0.5.6
type PPTXChartSeries struct {
// contains filtered or unexported fields
}
PPTXChartSeries represents a data series in a chart.
func (*PPTXChartSeries) GetName ¶ added in v0.5.6
func (s *PPTXChartSeries) GetName() string
GetName returns the series name.
func (*PPTXChartSeries) GetValues ¶ added in v0.5.6
func (s *PPTXChartSeries) GetValues() []float64
GetValues returns the values.
func (*PPTXChartSeries) HashKey ¶ added in v0.5.6
func (s *PPTXChartSeries) HashKey() HashKey
func (*PPTXChartSeries) Inspect ¶ added in v0.5.6
func (s *PPTXChartSeries) Inspect() string
func (*PPTXChartSeries) SetName ¶ added in v0.5.6
func (s *PPTXChartSeries) SetName(name string)
SetName sets the series name.
func (*PPTXChartSeries) SetValues ¶ added in v0.5.6
func (s *PPTXChartSeries) SetValues(values []float64)
SetValues sets the values.
func (*PPTXChartSeries) ToBool ¶ added in v0.5.6
func (s *PPTXChartSeries) ToBool() *Bool
func (*PPTXChartSeries) Type ¶ added in v0.5.6
func (s *PPTXChartSeries) Type() ObjectType
Type implementations for PPTXChartSeries
func (*PPTXChartSeries) TypeTag ¶ added in v0.5.6
func (s *PPTXChartSeries) TypeTag() TypeTag
type PPTXChartSeriesData ¶ added in v0.5.6
PPTXChartSeriesData represents a data series input.
type PPTXChartStyle ¶ added in v0.5.6
type PPTXChartStyle struct {
// contains filtered or unexported fields
}
PPTXChartStyle represents chart styling.
type PPTXColor ¶ added in v0.5.6
type PPTXColor struct {
R, G, B uint8
}
PPTXColor represents RGB color.
type PPTXDocument ¶ added in v0.5.6
type PPTXDocument struct {
// contains filtered or unexported fields
}
PPTXDocument represents a PowerPoint presentation. A .pptx file is a ZIP archive containing XML files.
func NewPPTX ¶ added in v0.5.6
func NewPPTX() *PPTXDocument
NewPPTX creates a new empty presentation.
func OpenPPTX ¶ added in v0.5.6
func OpenPPTX(path string) (*PPTXDocument, error)
OpenPPTX opens an existing PPTX file from a file path.
func OpenPPTXFromBytes ¶ added in v0.5.6
func OpenPPTXFromBytes(data []byte) (*PPTXDocument, error)
OpenPPTXFromBytes opens a PPTX presentation from a byte slice.
func (*PPTXDocument) AddSlide ¶ added in v0.5.6
func (d *PPTXDocument) AddSlide() *PPTXSlide
AddSlide adds a new slide to the presentation.
func (*PPTXDocument) Close ¶ added in v0.5.6
func (d *PPTXDocument) Close() error
Close closes the document and releases resources.
func (*PPTXDocument) DeleteSlide ¶ added in v0.5.6
func (d *PPTXDocument) DeleteSlide(index int) bool
DeleteSlide deletes a slide by index (1-based).
func (*PPTXDocument) DuplicateSlide ¶ added in v0.5.6
func (d *PPTXDocument) DuplicateSlide(index int) *PPTXSlide
DuplicateSlide creates a copy of a slide.
func (*PPTXDocument) GetProperties ¶ added in v0.5.6
func (d *PPTXDocument) GetProperties() *PPTXProperties
GetProperties returns the document properties.
func (*PPTXDocument) GetSlide ¶ added in v0.5.6
func (d *PPTXDocument) GetSlide(index int) *PPTXSlide
GetSlide returns a slide by index (1-based).
func (*PPTXDocument) GetSlideCount ¶ added in v0.5.6
func (d *PPTXDocument) GetSlideCount() int
GetSlideCount returns the number of slides.
func (*PPTXDocument) GetSlides ¶ added in v0.5.6
func (d *PPTXDocument) GetSlides() []*PPTXSlide
GetSlides returns all slides.
func (*PPTXDocument) HashKey ¶ added in v0.5.6
func (d *PPTXDocument) HashKey() HashKey
func (*PPTXDocument) Inspect ¶ added in v0.5.6
func (d *PPTXDocument) Inspect() string
func (*PPTXDocument) MoveSlide ¶ added in v0.5.6
func (d *PPTXDocument) MoveSlide(from, to int) bool
MoveSlide moves a slide from one position to another.
func (*PPTXDocument) Save ¶ added in v0.5.6
func (d *PPTXDocument) Save(path string) error
Save saves the document to a file.
func (*PPTXDocument) SetProperties ¶ added in v0.5.6
func (d *PPTXDocument) SetProperties(props *PPTXProperties)
SetProperties sets the document properties.
func (*PPTXDocument) ToBool ¶ added in v0.5.6
func (d *PPTXDocument) ToBool() *Bool
func (*PPTXDocument) ToBytes ¶ added in v0.5.6
func (d *PPTXDocument) ToBytes() ([]byte, error)
ToBytes converts the document to a byte slice.
func (*PPTXDocument) Type ¶ added in v0.5.6
func (d *PPTXDocument) Type() ObjectType
func (*PPTXDocument) TypeTag ¶ added in v0.5.6
func (d *PPTXDocument) TypeTag() TypeTag
type PPTXFormatScheme ¶ added in v0.5.6
type PPTXFormatScheme struct {
// contains filtered or unexported fields
}
PPTXFormatScheme defines format scheme.
type PPTXGradient ¶ added in v0.5.6
type PPTXGradient struct {
// contains filtered or unexported fields
}
PPTXGradient represents gradient fill.
type PPTXImage ¶ added in v0.5.6
type PPTXImage struct {
// contains filtered or unexported fields
}
PPTXImage represents an image on a slide.
func (*PPTXImage) GetDataBase64 ¶ added in v0.5.6
GetDataBase64 returns the image data as base64.
func (*PPTXImage) GetPosition ¶ added in v0.5.6
func (i *PPTXImage) GetPosition() PPTXPosition
GetPosition returns the position.
func (*PPTXImage) SetPosition ¶ added in v0.5.6
SetPosition sets the position.
func (*PPTXImage) Type ¶ added in v0.5.6
func (i *PPTXImage) Type() ObjectType
Type implementations for PPTXImage
type PPTXParagraph ¶ added in v0.5.6
type PPTXParagraph struct {
// contains filtered or unexported fields
}
PPTXParagraph represents a paragraph within a text frame.
func (*PPTXParagraph) GetAlignment ¶ added in v0.5.6
func (p *PPTXParagraph) GetAlignment() string
GetAlignment returns the alignment.
func (*PPTXParagraph) GetRuns ¶ added in v0.5.6
func (p *PPTXParagraph) GetRuns() []*PPTXTextRun
GetRuns returns all text runs.
func (*PPTXParagraph) GetText ¶ added in v0.5.6
func (p *PPTXParagraph) GetText() string
GetText returns the text content.
func (*PPTXParagraph) HashKey ¶ added in v0.5.6
func (p *PPTXParagraph) HashKey() HashKey
func (*PPTXParagraph) Inspect ¶ added in v0.5.6
func (p *PPTXParagraph) Inspect() string
func (*PPTXParagraph) SetAlignment ¶ added in v0.5.6
func (p *PPTXParagraph) SetAlignment(align string)
SetAlignment sets the alignment.
func (*PPTXParagraph) ToBool ¶ added in v0.5.6
func (p *PPTXParagraph) ToBool() *Bool
func (*PPTXParagraph) Type ¶ added in v0.5.6
func (p *PPTXParagraph) Type() ObjectType
Type implementations for PPTXParagraph
func (*PPTXParagraph) TypeTag ¶ added in v0.5.6
func (p *PPTXParagraph) TypeTag() TypeTag
type PPTXPosition ¶ added in v0.5.6
PPTXPosition represents element position in EMUs (English Metric Units).
type PPTXProperties ¶ added in v0.5.6
type PPTXProperties struct {
Title string
Subject string
Author string
Keywords string
Description string
Created string
Modified string
LastModBy string
Revision int
Category string
Company string
}
PPTXProperties holds document metadata.
type PPTXShadow ¶ added in v0.5.6
PPTXShadow represents shadow effect.
type PPTXShape ¶ added in v0.5.6
type PPTXShape struct {
// contains filtered or unexported fields
}
PPTXShape represents a shape on a slide.
func (*PPTXShape) AddTextFrame ¶ added in v0.5.6
func (s *PPTXShape) AddTextFrame(text string) *PPTXTextFrame
AddTextFrame adds a text frame to the shape.
func (*PPTXShape) GetKind ¶ added in v0.5.6
func (s *PPTXShape) GetKind() PPTXShapeKind
GetKind returns the shape kind.
func (*PPTXShape) GetPosition ¶ added in v0.5.6
func (s *PPTXShape) GetPosition() PPTXPosition
GetPosition returns the position.
func (*PPTXShape) GetTextFrame ¶ added in v0.5.6
func (s *PPTXShape) GetTextFrame() *PPTXTextFrame
GetTextFrame returns the text frame.
func (*PPTXShape) SetPosition ¶ added in v0.5.6
SetPosition sets the position.
func (*PPTXShape) Type ¶ added in v0.5.6
func (s *PPTXShape) Type() ObjectType
Type implementations for PPTXShape
type PPTXShapeKind ¶ added in v0.5.6
type PPTXShapeKind string
PPTXShapeKind defines shape types.
const ( PPTXShapeRectangle PPTXShapeKind = "rect" PPTXShapeOval PPTXShapeKind = "ellipse" PPTXShapeRoundRect PPTXShapeKind = "roundRect" PPTXShapeTriangle PPTXShapeKind = "triangle" PPTXShapeLine PPTXShapeKind = "line" PPTXShapeArrow PPTXShapeKind = "arrow" PPTXShapeTextBox PPTXShapeKind = "textBox" PPTXShapePicture PPTXShapeKind = "picture" )
type PPTXShapeStyle ¶ added in v0.5.6
type PPTXShapeStyle struct {
Fill *PPTXColor
FillTransparency float64
BorderColor *PPTXColor
BorderWidth int64
BorderStyle string // "solid", "dashed", "none"
Shadow *PPTXShadow
}
PPTXShapeStyle represents shape styling.
type PPTXSlide ¶ added in v0.5.6
type PPTXSlide struct {
// contains filtered or unexported fields
}
PPTXSlide represents a single slide in a presentation.
func (*PPTXSlide) AddChart ¶ added in v0.5.6
func (s *PPTXSlide) AddChart(chartKind PPTXChartKind, data PPTXChartData, options map[string]interface{}) *PPTXChart
AddChart adds a chart to the slide.
func (*PPTXSlide) AddImageFromBytes ¶ added in v0.5.6
func (s *PPTXSlide) AddImageFromBytes(data []byte, format string, options map[string]interface{}) *PPTXImage
AddImageFromBytes adds an image to the slide from byte data.
func (*PPTXSlide) AddShape ¶ added in v0.5.6
func (s *PPTXSlide) AddShape(shapeKind PPTXShapeKind, options map[string]interface{}) *PPTXShape
AddShape adds a shape to the slide.
func (*PPTXSlide) AddText ¶ added in v0.5.6
func (s *PPTXSlide) AddText(text string, options map[string]interface{}) *PPTXTextFrame
AddText adds a text frame to the slide.
func (*PPTXSlide) GetAllText ¶ added in v0.5.6
GetAllText returns all text content combined.
func (*PPTXSlide) GetTexts ¶ added in v0.5.6
func (s *PPTXSlide) GetTexts() []*PPTXTextFrame
GetTexts returns all text frames on the slide.
func (*PPTXSlide) Type ¶ added in v0.5.6
func (s *PPTXSlide) Type() ObjectType
Type implementations for PPTXSlide
type PPTXSlideBackground ¶ added in v0.5.6
type PPTXSlideBackground struct {
// contains filtered or unexported fields
}
PPTXSlideBackground represents slide background.
type PPTXSlideLayout ¶ added in v0.5.6
type PPTXSlideLayout struct {
// contains filtered or unexported fields
}
PPTXSlideLayout represents a slide layout template.
func (*PPTXSlideLayout) HashKey ¶ added in v0.5.6
func (l *PPTXSlideLayout) HashKey() HashKey
func (*PPTXSlideLayout) Inspect ¶ added in v0.5.6
func (l *PPTXSlideLayout) Inspect() string
func (*PPTXSlideLayout) ToBool ¶ added in v0.5.6
func (l *PPTXSlideLayout) ToBool() *Bool
func (*PPTXSlideLayout) Type ¶ added in v0.5.6
func (l *PPTXSlideLayout) Type() ObjectType
Type implementations for PPTXSlideLayout
func (*PPTXSlideLayout) TypeTag ¶ added in v0.5.6
func (l *PPTXSlideLayout) TypeTag() TypeTag
type PPTXSlideMaster ¶ added in v0.5.6
type PPTXSlideMaster struct {
// contains filtered or unexported fields
}
PPTXSlideMaster represents a slide master.
func (*PPTXSlideMaster) HashKey ¶ added in v0.5.6
func (m *PPTXSlideMaster) HashKey() HashKey
func (*PPTXSlideMaster) Inspect ¶ added in v0.5.6
func (m *PPTXSlideMaster) Inspect() string
func (*PPTXSlideMaster) ToBool ¶ added in v0.5.6
func (m *PPTXSlideMaster) ToBool() *Bool
func (*PPTXSlideMaster) Type ¶ added in v0.5.6
func (m *PPTXSlideMaster) Type() ObjectType
Type implementations for PPTXSlideMaster
func (*PPTXSlideMaster) TypeTag ¶ added in v0.5.6
func (m *PPTXSlideMaster) TypeTag() TypeTag
type PPTXTable ¶ added in v0.5.6
type PPTXTable struct {
// contains filtered or unexported fields
}
PPTXTable represents a table on a slide.
func (*PPTXTable) GetCell ¶ added in v0.5.6
func (t *PPTXTable) GetCell(row, col int) *PPTXTableCell
GetCell returns a cell by row and column (1-based).
func (*PPTXTable) GetColCount ¶ added in v0.5.6
GetColCount returns the number of columns.
func (*PPTXTable) GetPosition ¶ added in v0.5.6
func (t *PPTXTable) GetPosition() PPTXPosition
GetPosition returns the position.
func (*PPTXTable) GetRowCount ¶ added in v0.5.6
GetRowCount returns the number of rows.
func (*PPTXTable) SetPosition ¶ added in v0.5.6
SetPosition sets the position.
func (*PPTXTable) Type ¶ added in v0.5.6
func (t *PPTXTable) Type() ObjectType
Type implementations for PPTXTable
type PPTXTableCell ¶ added in v0.5.6
type PPTXTableCell struct {
// contains filtered or unexported fields
}
PPTXTableCell represents a table cell.
func (*PPTXTableCell) HashKey ¶ added in v0.5.6
func (c *PPTXTableCell) HashKey() HashKey
func (*PPTXTableCell) Inspect ¶ added in v0.5.6
func (c *PPTXTableCell) Inspect() string
func (*PPTXTableCell) ToBool ¶ added in v0.5.6
func (c *PPTXTableCell) ToBool() *Bool
func (*PPTXTableCell) Type ¶ added in v0.5.6
func (c *PPTXTableCell) Type() ObjectType
Type implementations for PPTXTableCell
func (*PPTXTableCell) TypeTag ¶ added in v0.5.6
func (c *PPTXTableCell) TypeTag() TypeTag
type PPTXTableStyle ¶ added in v0.5.6
type PPTXTableStyle struct {
HeaderRow PPTXCellStyle
TotalRow PPTXCellStyle
FirstCol PPTXCellStyle
LastCol PPTXCellStyle
BandRow bool
BandCol bool
}
PPTXTableStyle represents table styling.
type PPTXTextFrame ¶ added in v0.5.6
type PPTXTextFrame struct {
// contains filtered or unexported fields
}
PPTXTextFrame represents a text box on a slide.
func (*PPTXTextFrame) GetParagraphs ¶ added in v0.5.6
func (tf *PPTXTextFrame) GetParagraphs() []*PPTXParagraph
GetParagraphs returns all paragraphs.
func (*PPTXTextFrame) GetPosition ¶ added in v0.5.6
func (tf *PPTXTextFrame) GetPosition() PPTXPosition
GetPosition returns the position.
func (*PPTXTextFrame) GetSize ¶ added in v0.5.6
func (tf *PPTXTextFrame) GetSize() PPTXSize
GetSize returns the size.
func (*PPTXTextFrame) GetText ¶ added in v0.5.6
func (tf *PPTXTextFrame) GetText() string
GetText returns the text content.
func (*PPTXTextFrame) HashKey ¶ added in v0.5.6
func (tf *PPTXTextFrame) HashKey() HashKey
func (*PPTXTextFrame) Inspect ¶ added in v0.5.6
func (tf *PPTXTextFrame) Inspect() string
func (*PPTXTextFrame) SetPosition ¶ added in v0.5.6
func (tf *PPTXTextFrame) SetPosition(x, y int64)
SetPosition sets the position.
func (*PPTXTextFrame) SetSize ¶ added in v0.5.6
func (tf *PPTXTextFrame) SetSize(width, height int64)
SetSize sets the size.
func (*PPTXTextFrame) SetText ¶ added in v0.5.6
func (tf *PPTXTextFrame) SetText(text string)
SetText sets the text content.
func (*PPTXTextFrame) ToBool ¶ added in v0.5.6
func (tf *PPTXTextFrame) ToBool() *Bool
func (*PPTXTextFrame) Type ¶ added in v0.5.6
func (tf *PPTXTextFrame) Type() ObjectType
Type implementations for PPTXTextFrame
func (*PPTXTextFrame) TypeTag ¶ added in v0.5.6
func (tf *PPTXTextFrame) TypeTag() TypeTag
type PPTXTextRun ¶ added in v0.5.6
type PPTXTextRun struct {
// contains filtered or unexported fields
}
PPTXTextRun represents a text run with uniform formatting.
func (*PPTXTextRun) GetColor ¶ added in v0.5.6
func (r *PPTXTextRun) GetColor() string
GetColor returns the color as hex string.
func (*PPTXTextRun) GetFontName ¶ added in v0.5.6
func (r *PPTXTextRun) GetFontName() string
GetFontName returns the font name.
func (*PPTXTextRun) GetFontSize ¶ added in v0.5.6
func (r *PPTXTextRun) GetFontSize() int
GetFontSize returns the font size.
func (*PPTXTextRun) GetText ¶ added in v0.5.6
func (r *PPTXTextRun) GetText() string
GetText returns the text content.
func (*PPTXTextRun) HashKey ¶ added in v0.5.6
func (r *PPTXTextRun) HashKey() HashKey
func (*PPTXTextRun) Inspect ¶ added in v0.5.6
func (r *PPTXTextRun) Inspect() string
func (*PPTXTextRun) IsBold ¶ added in v0.5.6
func (r *PPTXTextRun) IsBold() bool
IsBold returns whether the text is bold.
func (*PPTXTextRun) IsItalic ¶ added in v0.5.6
func (r *PPTXTextRun) IsItalic() bool
IsItalic returns whether the text is italic.
func (*PPTXTextRun) SetBold ¶ added in v0.5.6
func (r *PPTXTextRun) SetBold(bold bool)
SetBold sets the bold flag.
func (*PPTXTextRun) SetColor ¶ added in v0.5.6
func (r *PPTXTextRun) SetColor(hex string)
SetColor sets the color from hex string.
func (*PPTXTextRun) SetFontName ¶ added in v0.5.6
func (r *PPTXTextRun) SetFontName(name string)
SetFontName sets the font name.
func (*PPTXTextRun) SetFontSize ¶ added in v0.5.6
func (r *PPTXTextRun) SetFontSize(size int)
SetFontSize sets the font size.
func (*PPTXTextRun) SetItalic ¶ added in v0.5.6
func (r *PPTXTextRun) SetItalic(italic bool)
SetItalic sets the italic flag.
func (*PPTXTextRun) SetText ¶ added in v0.5.6
func (r *PPTXTextRun) SetText(text string)
SetText sets the text content.
func (*PPTXTextRun) ToBool ¶ added in v0.5.6
func (r *PPTXTextRun) ToBool() *Bool
func (*PPTXTextRun) Type ¶ added in v0.5.6
func (r *PPTXTextRun) Type() ObjectType
Type implementations for PPTXTextRun
func (*PPTXTextRun) TypeTag ¶ added in v0.5.6
func (r *PPTXTextRun) TypeTag() TypeTag
type PPTXTheme ¶ added in v0.5.6
type PPTXTheme struct {
// contains filtered or unexported fields
}
PPTXTheme represents a presentation theme.
func (*PPTXTheme) Type ¶ added in v0.5.6
func (t *PPTXTheme) Type() ObjectType
Type implementations for PPTXTheme
type PPTXThemeColors ¶ added in v0.5.6
type PPTXThemeColors struct {
// contains filtered or unexported fields
}
PPTXThemeColors defines theme color scheme.
type PPTXThemeFonts ¶ added in v0.5.6
type PPTXThemeFonts struct {
// contains filtered or unexported fields
}
PPTXThemeFonts defines theme fonts.
type PPTXVideo ¶ added in v0.5.6
type PPTXVideo struct {
// contains filtered or unexported fields
}
PPTXVideo represents a video on a slide.
func (*PPTXVideo) GetPosition ¶ added in v0.5.6
func (v *PPTXVideo) GetPosition() PPTXPosition
GetPosition returns the position.
func (*PPTXVideo) SetPosition ¶ added in v0.5.6
SetPosition sets the position.
func (*PPTXVideo) Type ¶ added in v0.5.6
func (v *PPTXVideo) Type() ObjectType
Type implementations for PPTXVideo
type Parser ¶ added in v0.5.13
type Parser struct {
// contains filtered or unexported fields
}
Parser holds the parser state
type QRCode ¶ added in v0.5.13
type QRCode struct {
Version int
Level QRCodeLevel
Mode QRCodeMode
Modules [][]bool // true = black, false = white
Size int
Data []byte
}
QRCode represents a QR code
type QRCodeLevel ¶ added in v0.5.13
type QRCodeLevel int
QRCodeLevel represents error correction level
const ( QRLevelLow QRCodeLevel = iota // 7% error correction QRLevelMedium // 15% error correction QRLevelQuartile // 25% error correction QRLevelHigh // 30% error correction )
type QRCodeMode ¶ added in v0.5.13
type QRCodeMode int
QRCodeMode represents encoding mode
const ( QRModeNumeric QRCodeMode = iota QRModeAlphanumeric QRModeByte QRModeKanji )
type Queue ¶ added in v0.5.2
type Queue struct {
// contains filtered or unexported fields
}
Queue represents a FIFO queue (not thread-safe).
func NewQueueFrom ¶ added in v0.5.2
NewQueueFrom creates a new queue from an array.
func NewQueueWithCapacity ¶ added in v0.5.2
NewQueueWithCapacity creates a new queue with the specified initial capacity.
func (*Queue) Clear ¶ added in v0.5.2
func (q *Queue) Clear()
Clear removes all elements from the queue.
func (*Queue) Peek ¶ added in v0.5.2
Peek returns the front element without removing it. Returns NULL if the queue is empty.
func (*Queue) PeekBack ¶ added in v0.5.2
PeekBack returns the back element without removing it. Returns NULL if the queue is empty.
func (*Queue) Pop ¶ added in v0.5.2
Pop removes and returns the front element of the queue. Returns NULL if the queue is empty.
func (*Queue) Type ¶ added in v0.5.2
func (q *Queue) Type() ObjectType
Type returns the object type.
type RWMutex ¶ added in v0.4.25
type RWMutex struct {
// contains filtered or unexported fields
}
RWMutex wraps sync.RWMutex for use in Xxlang
func (*RWMutex) RUnlock ¶ added in v0.4.25
func (m *RWMutex) RUnlock()
RUnlock releases the read lock
func (*RWMutex) TryLock ¶ added in v0.4.25
TryLock attempts to acquire the write lock without blocking
func (*RWMutex) TryRLock ¶ added in v0.4.25
TryRLock attempts to acquire the read lock without blocking
func (*RWMutex) Type ¶ added in v0.4.25
func (m *RWMutex) Type() ObjectType
Object interface implementation
type Reader ¶ added in v0.4.25
Reader wraps an io.Reader for streaming read operations. It implements io.ReadCloser interface.
func (*Reader) Read ¶ added in v0.4.25
Read reads up to n bytes from the reader and returns as byte array.
func (*Reader) ReadAllBytes ¶ added in v0.4.25
ReadAllBytes reads all remaining content and returns as byte array.
func (*Reader) ReadAllStr ¶ added in v0.4.25
ReadAll reads all remaining content and returns as string.
func (*Reader) ReadLine ¶ added in v0.4.25
ReadLine reads a single line from the reader. Returns null on EOF, or error on failure.
func (*Reader) Type ¶ added in v0.4.25
func (r *Reader) Type() ObjectType
Type returns the object type.
type Return ¶
type Return struct {
Value Object
}
Return represents a return value (used internally)
func (*Return) Type ¶
func (r *Return) Type() ObjectType
type SSHClient ¶ added in v0.5.9
type SSHClient struct {
// contains filtered or unexported fields
}
SSHClient represents an SSH client connection.
func NewSSHClient ¶ added in v0.5.9
func NewSSHClient() *SSHClient
NewSSHClient creates a new SSHClient (unconnected).
func (*SSHClient) ConnectWithConfig ¶ added in v0.5.9
ConnectWithConfig establishes SSH connection with full configuration.
func (*SSHClient) ConnectWithKey ¶ added in v0.5.9
ConnectWithKey establishes SSH connection with private key file.
func (*SSHClient) ConnectWithKeyStr ¶ added in v0.5.9
ConnectWithKeyStr establishes SSH connection with private key string.
func (*SSHClient) DownloadDir ¶ added in v0.5.9
DownloadDir downloads a remote directory to local.
func (*SSHClient) ExecFull ¶ added in v0.5.9
ExecFull executes a command and returns stdout, stderr, and exit code.
func (*SSHClient) ExecStream ¶ added in v0.5.9
ExecStream executes a command with streaming output. Returns a channel for output lines and an error channel.
func (*SSHClient) GetClient ¶ added in v0.5.9
GetClient returns the underlying ssh.Client (for advanced use).
func (*SSHClient) Inspect ¶ added in v0.5.9
Inspect returns a string representation of the SSHClient.
func (*SSHClient) IsConnected ¶ added in v0.5.9
IsConnected returns the connection status.
func (*SSHClient) LocalForward ¶ added in v0.5.9
func (c *SSHClient) LocalForward(localPort int, remoteHost string, remotePort int) (net.Listener, error)
LocalForward creates local port forwarding. Returns a forwarding ID that can be used to stop it.
func (*SSHClient) RunScript ¶ added in v0.5.9
RunScript executes a local script file on the remote server.
func (*SSHClient) RunScriptStr ¶ added in v0.5.9
RunScriptStr executes a script string on the remote server.
func (*SSHClient) Type ¶ added in v0.5.9
func (c *SSHClient) Type() ObjectType
Type returns the object type.
type SSHConfig ¶ added in v0.5.9
type SSHConfig struct {
Host string
Port int
User string
Password string
KeyPath string
KeyStr string
KeyPassphrase string
Timeout int // seconds
KnownHostsPath string
IgnoreHostKey bool
}
SSHConfig holds SSH connection configuration.
type Scanner ¶ added in v0.4.25
type Scanner struct {
// contains filtered or unexported fields
}
Scanner provides convenient methods for reading input. It wraps a bufio.Reader for efficient reading.
func NewScanner ¶ added in v0.4.25
NewScanner creates a new Scanner from an io.Reader. If reader is nil, it defaults to os.Stdin.
func (*Scanner) Type ¶ added in v0.4.25
func (s *Scanner) Type() ObjectType
Type returns the object type.
type Set ¶ added in v0.5.2
type Set struct {
// contains filtered or unexported fields
}
Set represents an unordered collection of unique elements (not thread-safe).
func NewSetFrom ¶ added in v0.5.2
NewSetFrom creates a new set from an array.
func NewSetWithCapacity ¶ added in v0.5.2
NewSetWithCapacity creates a new set with the specified initial capacity.
func (*Set) Add ¶ added in v0.5.2
Add adds an element to the set. Returns true if added, false if already present.
func (*Set) Difference ¶ added in v0.5.2
Difference returns a new set containing elements in s but not in other.
func (*Set) Intersect ¶ added in v0.5.2
Intersect returns a new set containing elements present in both sets.
func (*Set) IsSuperset ¶ added in v0.5.2
IsSuperset returns true if s is a superset of other.
func (*Set) Remove ¶ added in v0.5.2
Remove removes an element from the set. Returns true if removed, false if not found.
func (*Set) SymmetricDifference ¶ added in v0.5.2
SymmetricDifference returns a new set containing elements in either set but not both.
func (*Set) ToSortedArray ¶ added in v0.5.2
ToSortedArray returns all elements as an array, sorted by Inspect() representation.
type SftpClient ¶ added in v0.5.9
type SftpClient struct {
// contains filtered or unexported fields
}
SftpClient represents an SFTP client connection.
func NewSftpClient ¶ added in v0.5.9
func NewSftpClient() *SftpClient
NewSftpClient creates a new SftpClient (unconnected).
func (*SftpClient) Chmod ¶ added in v0.5.9
func (c *SftpClient) Chmod(remotePath string, mode uint32) error
Chmod changes file permissions.
func (*SftpClient) Close ¶ added in v0.5.9
func (c *SftpClient) Close() error
Close closes the SFTP connection.
func (*SftpClient) CloseHandle ¶ added in v0.5.9
func (c *SftpClient) CloseHandle(handle string) error
CloseHandle closes a file handle.
func (*SftpClient) Connect ¶ added in v0.5.9
func (c *SftpClient) Connect(host string, port int, user, password string) error
Connect establishes SFTP connection with password.
func (*SftpClient) ConnectWithConfig ¶ added in v0.5.9
func (c *SftpClient) ConnectWithConfig(config *SftpConfig) error
ConnectWithConfig establishes SFTP connection with full configuration.
func (*SftpClient) ConnectWithKey ¶ added in v0.5.9
func (c *SftpClient) ConnectWithKey(host string, port int, user, keyPath string) error
ConnectWithKey establishes SFTP connection with private key file.
func (*SftpClient) ConnectWithKeyStr ¶ added in v0.5.9
func (c *SftpClient) ConnectWithKeyStr(host string, port int, user, keyStr string) error
ConnectWithKeyStr establishes SFTP connection with private key string.
func (*SftpClient) Create ¶ added in v0.5.9
func (c *SftpClient) Create(remotePath string) (string, error)
Create creates a remote file for writing.
func (*SftpClient) Delete ¶ added in v0.5.9
func (c *SftpClient) Delete(remotePath string) error
Delete deletes a remote file.
func (*SftpClient) Download ¶ added in v0.5.9
func (c *SftpClient) Download(remotePath, localPath string) error
Download downloads a remote file to the local filesystem.
func (*SftpClient) Exists ¶ added in v0.5.9
func (c *SftpClient) Exists(remotePath string) bool
Exists checks if a remote path exists.
func (*SftpClient) GetHost ¶ added in v0.5.9
func (c *SftpClient) GetHost() string
GetHost returns the connected host.
func (*SftpClient) GetPort ¶ added in v0.5.9
func (c *SftpClient) GetPort() int
GetPort returns the connected port.
func (*SftpClient) GetUser ¶ added in v0.5.9
func (c *SftpClient) GetUser() string
GetUser returns the username.
func (*SftpClient) HashKey ¶ added in v0.5.9
func (c *SftpClient) HashKey() HashKey
HashKey returns a hash key for the SftpClient.
func (*SftpClient) Inspect ¶ added in v0.5.9
func (c *SftpClient) Inspect() string
Inspect returns a string representation of the SftpClient.
func (*SftpClient) IsConnected ¶ added in v0.5.9
func (c *SftpClient) IsConnected() bool
IsConnected returns the connection status.
func (*SftpClient) IsDir ¶ added in v0.5.9
func (c *SftpClient) IsDir(remotePath string) bool
IsDir checks if a remote path is a directory.
func (*SftpClient) IsFile ¶ added in v0.5.9
func (c *SftpClient) IsFile(remotePath string) bool
IsFile checks if a remote path is a regular file.
func (*SftpClient) ListDir ¶ added in v0.5.9
func (c *SftpClient) ListDir(remotePath string) ([]SftpFileInfo, error)
ListDir lists the contents of a remote directory.
func (*SftpClient) Lstat ¶ added in v0.5.9
func (c *SftpClient) Lstat(remotePath string) (*SftpFileInfo, error)
Lstat returns file information without following symlinks.
func (*SftpClient) Mkdir ¶ added in v0.5.9
func (c *SftpClient) Mkdir(remotePath string) error
Mkdir creates a remote directory.
func (*SftpClient) MkdirAll ¶ added in v0.5.9
func (c *SftpClient) MkdirAll(remotePath string) error
MkdirAll creates a remote directory with parents.
func (*SftpClient) Open ¶ added in v0.5.9
func (c *SftpClient) Open(remotePath string) (string, error)
Open opens a remote file for reading.
func (*SftpClient) OpenFile ¶ added in v0.5.9
func (c *SftpClient) OpenFile(remotePath string, flags uint32) (string, error)
OpenFile opens a remote file with specified flags.
func (*SftpClient) ReadLink ¶ added in v0.5.9
func (c *SftpClient) ReadLink(remotePath string) (string, error)
ReadLink reads a symbolic link.
func (*SftpClient) RealPath ¶ added in v0.5.9
func (c *SftpClient) RealPath(remotePath string) (string, error)
RealPath returns the canonical path.
func (*SftpClient) Rename ¶ added in v0.5.9
func (c *SftpClient) Rename(oldPath, newPath string) error
Rename renames a remote file.
func (*SftpClient) Rmdir ¶ added in v0.5.9
func (c *SftpClient) Rmdir(remotePath string) error
Rmdir removes an empty remote directory.
func (*SftpClient) RmdirAll ¶ added in v0.5.9
func (c *SftpClient) RmdirAll(remotePath string) error
RmdirAll removes a remote directory recursively.
func (*SftpClient) Stat ¶ added in v0.5.9
func (c *SftpClient) Stat(remotePath string) (*SftpFileInfo, error)
Stat returns file information.
func (*SftpClient) Symlink ¶ added in v0.5.9
func (c *SftpClient) Symlink(oldPath, newPath string) error
Symlink creates a symbolic link.
func (*SftpClient) ToBool ¶ added in v0.5.9
func (c *SftpClient) ToBool() *Bool
ToBool returns true if connected.
func (*SftpClient) Truncate ¶ added in v0.5.9
func (c *SftpClient) Truncate(remotePath string, size int64) error
Truncate truncates a file.
func (*SftpClient) Type ¶ added in v0.5.9
func (c *SftpClient) Type() ObjectType
Type returns the object type.
func (*SftpClient) TypeTag ¶ added in v0.5.9
func (c *SftpClient) TypeTag() TypeTag
TypeTag returns the fast type tag.
func (*SftpClient) Upload ¶ added in v0.5.9
func (c *SftpClient) Upload(localPath, remotePath string) error
Upload uploads a local file to the remote server.
type SftpConfig ¶ added in v0.5.9
type SftpConfig struct {
Host string
Port int
User string
Password string
KeyPath string
KeyStr string
KeyPassphrase string
Timeout int
IgnoreHostKey bool
}
SftpConfig holds SFTP connection configuration.
type SftpFileInfo ¶ added in v0.5.9
type SftpFileInfo struct {
Name string
Size int64
Mode uint32
ModTime int64 // Unix timestamp
IsDir bool
}
SftpFileInfo represents file information from SFTP.
type SftpServer ¶ added in v0.5.9
type SftpServer struct {
// contains filtered or unexported fields
}
SftpServer represents an SFTP server.
func NewSftpServer ¶ added in v0.5.9
func NewSftpServer() *SftpServer
NewSftpServer creates a new SftpServer.
func (*SftpServer) AddUser ¶ added in v0.5.9
func (s *SftpServer) AddUser(username, password, homeDir string) error
AddUser adds a user account with password.
func (*SftpServer) AddUserWithKey ¶ added in v0.5.9
func (s *SftpServer) AddUserWithKey(username, keyStr, homeDir string) error
AddUserWithKey adds a user account with public key.
func (*SftpServer) Create ¶ added in v0.5.9
func (s *SftpServer) Create(addr string, config *SftpServerConfig) error
Create creates and configures the SFTP server.
func (*SftpServer) HashKey ¶ added in v0.5.9
func (s *SftpServer) HashKey() HashKey
HashKey returns a hash key for the SftpServer.
func (*SftpServer) Inspect ¶ added in v0.5.9
func (s *SftpServer) Inspect() string
Inspect returns a string representation of the SftpServer.
func (*SftpServer) IsRunning ¶ added in v0.5.9
func (s *SftpServer) IsRunning() bool
IsRunning returns true if the server is running.
func (*SftpServer) RemoveUser ¶ added in v0.5.9
func (s *SftpServer) RemoveUser(username string) error
RemoveUser removes a user account.
func (*SftpServer) Start ¶ added in v0.5.9
func (s *SftpServer) Start() error
Start starts the SFTP server.
func (*SftpServer) Stop ¶ added in v0.5.9
func (s *SftpServer) Stop() error
Stop stops the SFTP server.
func (*SftpServer) ToBool ¶ added in v0.5.9
func (s *SftpServer) ToBool() *Bool
ToBool returns true if running.
func (*SftpServer) Type ¶ added in v0.5.9
func (s *SftpServer) Type() ObjectType
Type returns the object type.
func (*SftpServer) TypeTag ¶ added in v0.5.9
func (s *SftpServer) TypeTag() TypeTag
TypeTag returns the fast type tag.
type SftpServerConfig ¶ added in v0.5.9
type SftpServerConfig struct {
Host string
Port int
HostKey string // PEM format private key
HostKeyPath string
MaxConnections int
Timeout int // seconds
}
SftpServerConfig holds SFTP server configuration.
type Sheet ¶ added in v0.5.2
type Sheet struct {
Name string
Cells map[string]*Cell // key: "A1", "B2", etc.
Merges []MergeRange
RowCount int
ColCount int
Images []ImageInfo
}
Sheet represents a worksheet.
type SocketAddr ¶ added in v0.5.8
type SocketAddr struct {
// contains filtered or unexported fields
}
SocketAddr represents a network address with host and port. It is used for socket operations to specify endpoints.
func NewSocketAddr ¶ added in v0.5.8
func NewSocketAddr(host string, port int) *SocketAddr
NewSocketAddr creates a new SocketAddr with the given host and port.
func (*SocketAddr) HashKey ¶ added in v0.5.8
func (a *SocketAddr) HashKey() HashKey
HashKey returns a hash key for the SocketAddr.
func (*SocketAddr) Host ¶ added in v0.5.8
func (a *SocketAddr) Host() string
Host returns the host part of the address.
func (*SocketAddr) Inspect ¶ added in v0.5.8
func (a *SocketAddr) Inspect() string
Inspect returns a string representation of the SocketAddr.
func (*SocketAddr) Port ¶ added in v0.5.8
func (a *SocketAddr) Port() int
Port returns the port part of the address.
func (*SocketAddr) ToBool ¶ added in v0.5.8
func (a *SocketAddr) ToBool() *Bool
ToBool returns true (SocketAddr is always truthy).
func (*SocketAddr) ToStr ¶ added in v0.5.8
func (a *SocketAddr) ToStr() string
ToStr returns the address in "host:port" format. For IPv6 addresses, the host is wrapped in brackets.
func (*SocketAddr) Type ¶ added in v0.5.8
func (a *SocketAddr) Type() ObjectType
Type returns the object type.
func (*SocketAddr) TypeTag ¶ added in v0.5.8
func (a *SocketAddr) TypeTag() TypeTag
TypeTag returns the type tag for fast type checking.
type String ¶
type String struct {
Value string
}
String represents a string value
func GetBufferedString ¶ added in v0.4.23
GetBufferedString gets a temporary String using the global buffer
func InternBatch ¶
InternBatch pre-interns a batch of strings
func InternString ¶
InternString returns a cached *String for the given value This provides permanent caching for strings that are used often Use this for strings that will be reused many times (e.g., identifiers, keywords)
func NewString ¶ added in v0.4.23
NewString creates a new String object, using cached values for common strings
func NewStringSlice ¶ added in v0.4.23
NewStringSlice creates multiple String objects efficiently This is optimized for batch operations
type StringBuilder ¶ added in v0.4.19
type StringBuilder struct {
// contains filtered or unexported fields
}
StringBuilder is a mutable string builder for efficient string concatenation. Not thread-safe - use external synchronization if needed.
func NewStringBuilder ¶ added in v0.4.19
func NewStringBuilder() *StringBuilder
NewStringBuilder creates a new StringBuilder instance.
func (*StringBuilder) Cap ¶ added in v0.4.19
func (sb *StringBuilder) Cap() int
Cap returns the current capacity of the builder's internal buffer.
func (*StringBuilder) Clear ¶ added in v0.4.19
func (sb *StringBuilder) Clear()
Clear resets the builder, removing all content.
func (*StringBuilder) GetIOWriter ¶ added in v0.4.25
func (sb *StringBuilder) GetIOWriter() *stringBuilderWriter
GetIOWriter returns the builder as an io.Writer interface. This allows the StringBuilder to be used with Writer objects.
func (*StringBuilder) Grow ¶ added in v0.4.19
func (sb *StringBuilder) Grow(n int)
Grow grows the builder's capacity to hold at least n more bytes.
func (*StringBuilder) HashKey ¶ added in v0.4.19
func (sb *StringBuilder) HashKey() HashKey
HashKey returns a hash key for the StringBuilder.
func (*StringBuilder) Inspect ¶ added in v0.4.19
func (sb *StringBuilder) Inspect() string
Inspect returns a string representation.
func (*StringBuilder) Len ¶ added in v0.4.19
func (sb *StringBuilder) Len() int
Len returns the current length of the accumulated string.
func (*StringBuilder) Reset ¶ added in v0.4.19
func (sb *StringBuilder) Reset()
Reset is an alias for Clear.
func (*StringBuilder) String ¶ added in v0.4.19
func (sb *StringBuilder) String() string
String returns the accumulated string.
func (*StringBuilder) ToBool ¶ added in v0.4.19
func (sb *StringBuilder) ToBool() *Bool
ToBool returns true (StringBuilder is always truthy).
func (*StringBuilder) Type ¶ added in v0.4.19
func (sb *StringBuilder) Type() ObjectType
Type returns the object type.
func (*StringBuilder) TypeTag ¶ added in v0.4.19
func (sb *StringBuilder) TypeTag() TypeTag
TypeTag returns the fast type tag.
func (*StringBuilder) Write ¶ added in v0.4.19
func (sb *StringBuilder) Write(s string) int
Write appends a string to the builder.
func (*StringBuilder) WriteLine ¶ added in v0.4.19
func (sb *StringBuilder) WriteLine(s string) int
WriteLine appends a string followed by a newline to the builder.
type StringPoolStats ¶ added in v0.4.23
type StringPoolStats struct {
// CacheHits is the number of times a cached string was returned
CacheHits int64
// InternHits is the number of times an interned string was returned
InternHits int64
// PoolHits is the number of times a pooled string was reused
PoolHits int64
// Created is the number of new strings allocated by the pool
Created int64
// Released is the number of strings returned to the pool
Released int64
// Interned is the number of strings currently in the intern cache
Interned int64
}
StringPoolStats tracks statistics about string pool usage
func GetStringPoolStats ¶ added in v0.4.23
func GetStringPoolStats() StringPoolStats
GetStringPoolStats returns current statistics about string pool usage
type TcpClient ¶ added in v0.5.8
type TcpClient struct {
// contains filtered or unexported fields
}
TcpClient represents a TCP client connection. It provides methods for connecting to TCP servers, sending and receiving data. TcpClient is thread-safe and supports read timeouts.
func NewTcpClient ¶ added in v0.5.8
func NewTcpClient() *TcpClient
NewTcpClient creates a new unconnected TcpClient. The client must call Connect before sending or receiving data.
func NewTcpClientFromConn ¶ added in v0.5.8
NewTcpClientFromConn creates a TcpClient from an existing net.Conn. This is useful for server-side accepted connections.
func (*TcpClient) Close ¶ added in v0.5.8
Close closes the connection. Returns NULL on success, or an Error on failure.
func (*TcpClient) Connect ¶ added in v0.5.8
Connect establishes a TCP connection to the specified address. The address should be in the format "host:port". Returns NULL on success, or an Error on failure.
func (*TcpClient) Inspect ¶ added in v0.5.8
Inspect returns a string representation of the TcpClient.
func (*TcpClient) LocalAddr ¶ added in v0.5.8
LocalAddr returns the local address as a SocketAddr. Returns an Error if not connected.
func (*TcpClient) Receive ¶ added in v0.5.8
Receive reads up to n bytes and returns the data as a String. Returns NULL on timeout or EOF, or an Error on failure.
func (*TcpClient) ReceiveBytes ¶ added in v0.5.8
ReceiveBytes reads up to n bytes and returns the data as an Array of Ints. Each element in the array is a byte value (0-255). Returns NULL on timeout or EOF, or an Error on failure.
func (*TcpClient) ReceiveLine ¶ added in v0.5.8
ReceiveLine reads until newline and returns the line as a String. The trailing newline and carriage return are removed. Returns NULL on timeout or EOF, or an Error on failure.
func (*TcpClient) RemoteAddr ¶ added in v0.5.8
RemoteAddr returns the remote address as a SocketAddr. Returns an Error if not connected.
func (*TcpClient) SendBytes ¶ added in v0.5.8
SendBytes sends a byte slice over the connection. Returns the number of bytes sent as an Int, or an Error on failure.
func (*TcpClient) SendString ¶ added in v0.5.8
SendString sends a string over the connection. Returns the number of bytes sent as an Int, or an Error on failure.
func (*TcpClient) SetTimeout ¶ added in v0.5.8
SetTimeout sets the read timeout in milliseconds. A timeout of 0 means no timeout (blocking read). Returns NULL.
func (*TcpClient) Type ¶ added in v0.5.8
func (c *TcpClient) Type() ObjectType
Type returns the object type.
type TcpServer ¶ added in v0.5.8
type TcpServer struct {
// contains filtered or unexported fields
}
TcpServer represents a TCP server that can accept incoming connections. It provides methods for listening on a port, accepting connections, and handling connections via callbacks. TcpServer is thread-safe.
func NewTcpServer ¶ added in v0.5.8
func NewTcpServer() *TcpServer
NewTcpServer creates a new unbound TcpServer. The server must call Listen before accepting connections.
func (*TcpServer) Accept ¶ added in v0.5.8
Accept waits for and accepts the next incoming connection. If timeout > 0, it will return NULL after the timeout expires. Returns a TcpClient on success, NULL on timeout, or an Error on failure. If the server is not listening, returns an Error.
func (*TcpServer) Addr ¶ added in v0.5.8
func (s *TcpServer) Addr() *SocketAddr
Addr returns the address the server is listening on. Returns nil if the server is not listening.
func (*TcpServer) Close ¶ added in v0.5.8
Close stops the server and releases resources. Returns NULL on success, or an Error on failure.
func (*TcpServer) Inspect ¶ added in v0.5.8
Inspect returns a string representation of the TcpServer.
func (*TcpServer) Listen ¶ added in v0.5.8
Listen starts the TCP server on the specified address. The address should be in the format "host:port" or ":port". If port is 0, a random port will be assigned. Returns NULL on success, or an Error on failure.
func (*TcpServer) OnAccept ¶ added in v0.5.8
OnAccept sets a callback function to be called for each accepted connection. When a callback is set, the server will automatically accept connections in the background when Start() is called. Returns NULL.
func (*TcpServer) SetReuseAddr ¶ added in v0.5.8
SetReuseAddr sets whether to enable SO_REUSEADDR option. Must be called before Listen. Default is true. Returns NULL.
func (*TcpServer) SetTimeout ¶ added in v0.5.8
SetTimeout sets the accept timeout in milliseconds. This affects the Accept method when blocking. A timeout of 0 means no timeout (blocking accept). Returns NULL.
func (*TcpServer) Start ¶ added in v0.5.8
Start begins the accept loop in a background goroutine. Connections will be passed to the onAccept callback if set. Use Close() to stop the server. Returns NULL on success, or an Error if not listening or already running.
func (*TcpServer) ToBool ¶ added in v0.5.8
ToBool returns true if the server is listening and not closed.
func (*TcpServer) Type ¶ added in v0.5.8
func (s *TcpServer) Type() ObjectType
Type returns the object type.
type Time ¶ added in v0.5.13
Time represents a time object with various time components
func NewTimeFromComponents ¶ added in v0.5.13
NewTimeFromComponents creates a new Time object from date/time components
func NewTimeFromTimestamp ¶ added in v0.5.13
NewTimeFromTimestamp creates a new Time object from Unix timestamp (auto-detects seconds/milliseconds)
func (*Time) AddDuration ¶ added in v0.5.13
AddDuration adds a duration string (e.g., "1h", "30m", "1h30m")
func (*Time) DiffSecs ¶ added in v0.5.13
DiffSecs returns the difference in seconds between this time and another time
func (*Time) GetNanosecond ¶ added in v0.5.13
GetNanosecond returns the nanosecond
func (*Time) GetTimestamp ¶ added in v0.5.13
GetTimestamp returns Unix timestamp in seconds
func (*Time) GetTimestampMs ¶ added in v0.5.13
GetTimestampMs returns Unix timestamp in milliseconds
func (*Time) GetWeekday ¶ added in v0.5.13
GetWeekday returns the weekday (0=Sunday, 1=Monday, ..., 6=Saturday)
func (*Time) Type ¶ added in v0.5.13
func (t *Time) Type() ObjectType
type TokenType ¶ added in v0.5.13
type TokenType int
TokenType represents a token type
const ( TokenEOF TokenType = iota TokenError TokenComment TokenKey TokenEquals TokenString TokenMultiLineString TokenLiteralString TokenMultiLineLiteralString TokenInteger TokenFloat TokenBoolean TokenDatetime TokenDate TokenTime TokenLBracket // [ TokenRBracket // ] TokenDoubleLBracket // [[ TokenDoubleRBracket // ]] TokenLBrace // { TokenRBrace // } TokenLParen // ( TokenRParen // ) TokenComma TokenDot TokenNewline )
type TomlDocument ¶ added in v0.5.13
type TomlDocument struct {
// contains filtered or unexported fields
}
TomlDocument represents a parsed TOML document
func NewTomlDocument ¶ added in v0.5.13
func NewTomlDocument() *TomlDocument
NewTomlDocument creates a new empty TOML document
func ParseToml ¶ added in v0.5.13
func ParseToml(input string) (*TomlDocument, error)
ParseToml parses a TOML string and returns a document
func (*TomlDocument) Get ¶ added in v0.5.13
func (d *TomlDocument) Get(path string) *TomlValue
Get retrieves a value by path Path format: "section.key", "section.subsection.key", "array[0].key"
func (*TomlDocument) Has ¶ added in v0.5.13
func (d *TomlDocument) Has(path string) bool
Has checks if a path exists
func (*TomlDocument) HashKey ¶ added in v0.5.13
func (d *TomlDocument) HashKey() HashKey
HashKey returns a hash key
func (*TomlDocument) Inspect ¶ added in v0.5.13
func (d *TomlDocument) Inspect() string
Inspect returns a string representation
func (*TomlDocument) Keys ¶ added in v0.5.13
func (d *TomlDocument) Keys() []string
Keys returns all top-level keys
func (*TomlDocument) Merge ¶ added in v0.5.13
func (d *TomlDocument) Merge(other *TomlDocument) error
Merge merges another TOML document into this one
func (*TomlDocument) Remove ¶ added in v0.5.13
func (d *TomlDocument) Remove(path string) bool
Remove removes a value at the specified path
func (*TomlDocument) Root ¶ added in v0.5.13
func (d *TomlDocument) Root() *TomlValue
Root returns the root table
func (*TomlDocument) Save ¶ added in v0.5.13
func (d *TomlDocument) Save(path string) error
Save saves the document to a file
func (*TomlDocument) Sections ¶ added in v0.5.13
func (d *TomlDocument) Sections() []string
Sections returns all section names (top-level tables)
func (*TomlDocument) Set ¶ added in v0.5.13
func (d *TomlDocument) Set(path string, value *TomlValue) error
Set sets a value at the specified path
func (*TomlDocument) ToBool ¶ added in v0.5.13
func (d *TomlDocument) ToBool() *Bool
ToBool returns true
func (*TomlDocument) ToIndented ¶ added in v0.5.13
func (d *TomlDocument) ToIndented() string
ToIndented serializes with indentation
func (*TomlDocument) ToMap ¶ added in v0.5.13
func (d *TomlDocument) ToMap() *Map
ToMap converts the document to an Xxlang Map
func (*TomlDocument) ToString ¶ added in v0.5.13
func (d *TomlDocument) ToString() string
ToString serializes the document to a TOML string
func (*TomlDocument) Type ¶ added in v0.5.13
func (d *TomlDocument) Type() ObjectType
Type returns the object type
func (*TomlDocument) TypeTag ¶ added in v0.5.13
func (d *TomlDocument) TypeTag() TypeTag
TypeTag returns the type tag
type TomlValue ¶ added in v0.5.13
type TomlValue struct {
Type TomlValueType
Value interface{}
// contains filtered or unexported fields
}
TomlValue represents a value in TOML document
func CreateTomlValueFromInterface ¶ added in v0.5.13
func CreateTomlValueFromInterface(v interface{}) *TomlValue
CreateTomlValueFromInterface creates TomlValue from Go interface{}
func FromXxlangObject ¶ added in v0.5.13
FromXxlangObject converts Xxlang Object to TomlValue
func NewTomlValue ¶ added in v0.5.13
func NewTomlValue(valType TomlValueType, value interface{}) *TomlValue
NewTomlValue creates a new TomlValue
func (*TomlValue) IsScalar ¶ added in v0.5.13
IsScalar checks if the value is a scalar (non-container) type
func (*TomlValue) KeysString ¶ added in v0.5.13
KeysString returns keys as a comma-separated string
func (*TomlValue) Len ¶ added in v0.5.13
Len returns the length of an array or number of keys in a table
func (*TomlValue) ToXxlangObject ¶ added in v0.5.13
ToXxlangObject converts TomlValue to Xxlang Object
type TomlValueType ¶ added in v0.5.13
type TomlValueType int
TomlValueType represents the type of a TOML value
const ( TomlString TomlValueType = iota TomlInteger TomlFloat TomlBoolean TomlDatetime TomlDate TomlTime TomlArray TomlTable TomlNull )
func (TomlValueType) String ¶ added in v0.5.13
func (t TomlValueType) String() string
type ToneStyle ¶ added in v0.5.13
type ToneStyle int
ToneStyle defines how to represent tones in pinyin output
type Tube ¶ added in v0.4.25
type Tube struct {
// contains filtered or unexported fields
}
Tube represents a communication tube for concurrent message passing It wraps a Go channel for efficient implementation
func NewTube ¶ added in v0.4.25
func NewTube(elemType ObjectType, buffer int) *Tube
NewTube creates a new tube with optional type constraint and buffer size
func (*Tube) Close ¶ added in v0.4.25
func (t *Tube) Close()
Close closes the tube After closing, no more sends are allowed but receives continue until empty
func (*Tube) CloseMethod ¶ added in v0.4.25
CloseMethod is the method called as tube.close()
func (*Tube) ElemType ¶ added in v0.4.25
func (t *Tube) ElemType() ObjectType
ElemType returns the element type constraint (empty string if untyped)
func (*Tube) IsClosedMethod ¶ added in v0.4.25
IsClosedMethod is the method called as tube.isClosed()
func (*Tube) Receive ¶ added in v0.4.25
Receive receives a value from the tube (blocking) Returns (value, ok) where ok is false if tube is closed and empty
func (*Tube) ReceiveMethod ¶ added in v0.4.25
ReceiveMethod is the method called as tube.receive() Returns [value, ok] array
func (*Tube) ReflectValue ¶ added in v0.4.25
ReflectValue returns the underlying reflect.Value for use with reflect.Select
func (*Tube) Send ¶ added in v0.4.25
Send sends a value to the tube (blocking) Returns false if the tube is closed
func (*Tube) SendMethod ¶ added in v0.4.25
SendMethod is the method called as tube.send(value)
func (*Tube) SendWithTimeout ¶ added in v0.4.25
SendWithTimeout sends a value with timeout (in milliseconds) Returns (sent, ok) where ok is false if timeout or closed
func (*Tube) TryReceive ¶ added in v0.4.25
TryReceive attempts to receive without blocking Returns (value, received, open) where open is false if tube is closed
func (*Tube) TryReceiveMethod ¶ added in v0.4.25
TryReceiveMethod is the method called as tube.tryReceive() Returns [value, received, open] array
type TypeTag ¶
type TypeTag uint8
TypeTag is a fast integer type identifier for hot path checks
const ( TypeCodeNull TypeTag = iota TypeCodeBool TypeCodeInt TypeCodeFloat TypeCodeString TypeCodeArray TypeCodeMap TypeCodeFunction TypeCodeBuiltin TypeCodeError TypeCodeBytes TypeCodeChars TypeCodeBigInt TypeCodeBigFloat TypeCodeCompiledFunction TypeCodeOrderedMap )
Type code constants for typeCode function
const ( TagNull TypeTag = iota TagInt TagFloat TagString TagChars TagBool TagArray TagMap TagFunction TagBuiltin TagBytes TagClass TagInstance TagError TagReturn TagClosure TagModule TagStringBuilder TagBytesBuffer TagBigInt TagBigFloat TagHttpReq TagHttpResp TagHttpMux TagWebSocket TagTube TagMutex TagRWMutex TagWaitGroup TagOnce TagCond TagAtomicInt TagGoroutine TagContext TagFileUpload TagFileUploadResult TagFile TagFileInfo TagReader TagWriter TagScanner TagDB TagDBTx TagDBRows TagDBStmt TagOrderedMap TagQueue TagSet TagXLSX TagXMLDocument TagXMLNode TagDocxDocument TagDocxParagraph TagDocxRun TagDocxTable TagDocxTableRow TagDocxTableCell TagDocxImage TagDocxSection TagDocxHeader TagDocxStyle TagDocxHyperlink TagDocxBookmark TagDocxTOC TagDocxTextBox TagDocxShape TagDocxChart TagDocxComment TagDocxRevision TagDocxFootnote TagDocxEndnote // PPTX tags TagPPTXDocument TagPPTXSlide TagPPTXTextFrame TagPPTXParagraph TagPPTXTextRun TagPPTXShape TagPPTXTable TagPPTXTableCell TagPPTXChart TagPPTXChartSeries TagPPTXImage TagPPTXVideo TagPPTXAudio TagPPTXSlideLayout TagPPTXSlideMaster TagPPTXTheme // PDF tags TagPDF TagPDFDocument TagPDFPage TagPDFInfo // Socket tags TagSocketAddr TagTcpServer TagTcpClient TagUdpSocket // LineEditor tag TagLineEditor // SSH tag TagSSHClient // FTP/SFTP tags TagFtpClient TagFtpServer TagSftpClient TagSftpServer // HTML tags TagHTMLDocument TagHTMLElement // YAML tags TagYAMLDocument // Time tag TagTime TagUnknown )
Type tags for fast type checking (must match ObjectType order)
const TagCompiledFunction TypeTag = TagClosure // Use same tag as Closure
TagCompiledFunction is the type tag for compiled functions
const TagWebView TypeTag = 101 // Continue from existing tags
TagWebView is the type tag for WebView objects.
type UdpSocket ¶ added in v0.5.8
type UdpSocket struct {
// contains filtered or unexported fields
}
UdpSocket represents a UDP socket for connectionless datagram communication. It supports two modes: 1. Send-only mode: Created with NewUdpSocket(), can send but cannot receive 2. Bidirectional mode: After Bind(), can both send and receive UdpSocket is thread-safe.
func NewUdpSocket ¶ added in v0.5.8
func NewUdpSocket() *UdpSocket
NewUdpSocket creates a new unbound UDP socket. The socket can send datagrams immediately using SendTo/SendToBytes, but must call Bind() before it can receive datagrams.
func (*UdpSocket) Bind ¶ added in v0.5.8
Bind binds the socket to a local address. The address should be in the format "host:port" (e.g., ":8080" for all interfaces, port 8080). Use ":0" to bind to a random available port. Returns NULL on success, or an Error on failure.
func (*UdpSocket) Close ¶ added in v0.5.8
Close closes the UDP socket. Returns NULL on success, or an Error on failure.
func (*UdpSocket) Inspect ¶ added in v0.5.8
Inspect returns a string representation of the UdpSocket.
func (*UdpSocket) LocalAddr ¶ added in v0.5.8
LocalAddr returns the local address as a SocketAddr. Returns an Error if not bound.
func (*UdpSocket) ReceiveFrom ¶ added in v0.5.8
ReceiveFrom receives a datagram and returns the data as a String. Also returns the sender's address as a SocketAddr. Returns NULL for data on timeout, or an Error on failure. Requires Bind() to be called first.
func (*UdpSocket) ReceiveFromBytes ¶ added in v0.5.8
ReceiveFromBytes receives a datagram and returns the data as an Array of Ints. Each element in the array is a byte value (0-255). Also returns the sender's address as a SocketAddr. Returns NULL for data on timeout, or an Error on failure. Requires Bind() to be called first.
func (*UdpSocket) SendTo ¶ added in v0.5.8
SendTo sends a string to the specified address. The address should be in the format "host:port". Returns the number of bytes sent as an Int, or an Error on failure. This method can be used without calling Bind() first.
func (*UdpSocket) SendToBytes ¶ added in v0.5.8
SendToBytes sends a byte slice to the specified address. The address should be in the format "host:port". Returns the number of bytes sent as an Int, or an Error on failure. This method can be used without calling Bind() first.
func (*UdpSocket) SetTimeout ¶ added in v0.5.8
SetTimeout sets the read timeout in milliseconds. A timeout of 0 means no timeout (blocking read). Returns NULL.
func (*UdpSocket) Type ¶ added in v0.5.8
func (s *UdpSocket) Type() ObjectType
Type returns the object type.
type WaitGroup ¶ added in v0.4.25
type WaitGroup struct {
// contains filtered or unexported fields
}
WaitGroup wraps sync.WaitGroup for use in Xxlang
func NewWaitGroup ¶ added in v0.4.25
func NewWaitGroup() *WaitGroup
NewWaitGroup creates a new WaitGroup
func (*WaitGroup) Done ¶ added in v0.4.25
func (w *WaitGroup) Done()
Done decrements the WaitGroup counter
func (*WaitGroup) Type ¶ added in v0.4.25
func (w *WaitGroup) Type() ObjectType
Object interface implementation
type WebSocket ¶ added in v0.4.25
type WebSocket struct {
// Conn is the underlying WebSocket connection interface
Conn WebSocketConn
// contains filtered or unexported fields
}
WebSocket represents a WebSocket connection. It wraps the connection and provides methods for reading and writing messages.
func NewWebSocket ¶ added in v0.4.25
func NewWebSocket(conn WebSocketConn) *WebSocket
NewWebSocket creates a new WebSocket object.
func (*WebSocket) HashKey ¶ added in v0.4.25
HashKey returns a hash key for the WebSocket. WebSockets are not hashable in a meaningful way.
func (*WebSocket) Inspect ¶ added in v0.4.25
Inspect returns a string representation of the WebSocket.
func (*WebSocket) ReadMessage ¶ added in v0.4.25
ReadMessage reads a message from the WebSocket connection. Returns an array: [messageType, data]
func (*WebSocket) SendBinaryMessage ¶ added in v0.4.25
SendBinaryMessage sends a binary message over the WebSocket.
func (*WebSocket) SendCloseMessage ¶ added in v0.4.25
SendCloseMessage sends a close message over the WebSocket.
func (*WebSocket) SendTextMessage ¶ added in v0.4.25
SendTextMessage sends a text message over the WebSocket.
func (*WebSocket) ToBool ¶ added in v0.4.25
ToBool converts the WebSocket to a boolean (always true).
func (*WebSocket) Type ¶ added in v0.4.25
func (ws *WebSocket) Type() ObjectType
Type returns the object type.
type WebSocketConn ¶ added in v0.4.25
type WebSocketConn interface {
ReadMessage() (messageType int, p []byte, err error)
WriteMessage(messageType int, data []byte) error
Close() error
}
WebSocketConn defines the interface for WebSocket connections. This allows different implementations (gorilla, standard library, etc.)
type WebView ¶ added in v0.4.34
type WebView struct {
Handle interface{} // *webview2.WebView2 on Windows
// contains filtered or unexported fields
}
WebView represents a WebView2 window in Xxlang.
func NewWebView ¶ added in v0.4.34
func NewWebView(handle interface{}) *WebView
NewWebView creates a new WebView object.
func (*WebView) AddCallback ¶ added in v0.4.34
AddCallback adds a callback function.
func (*WebView) GetCallback ¶ added in v0.4.34
GetCallback gets a callback function.
func (*WebView) IsClosed ¶ added in v0.4.34
IsClosed returns true if the WebView is closed. Checks both the local closed flag and the underlying handle's closed state.
func (*WebView) Type ¶ added in v0.4.34
func (w *WebView) Type() ObjectType
Type returns the object type.
type Writer ¶ added in v0.4.25
Writer wraps an io.Writer for streaming write operations.
func (*Writer) Type ¶ added in v0.4.25
func (w *Writer) Type() ObjectType
Type returns the object type.
func (*Writer) WriteBytes ¶ added in v0.4.25
WriteBytes writes a byte array (array of integers) to the writer.
type XLSX ¶ added in v0.5.2
type XLSX struct {
// contains filtered or unexported fields
}
XLSX represents an Excel workbook.
func (*XLSX) DeleteSheet ¶ added in v0.5.2
DeleteSheet deletes a sheet.
func (*XLSX) ExtractImage ¶ added in v0.5.2
ExtractImage extracts an image to a file.
func (*XLSX) GetCellByIndex ¶ added in v0.5.2
GetCellByIndex returns a cell value by row/col indices (1-based).
func (*XLSX) GetColCount ¶ added in v0.5.2
GetColCount returns the number of columns in a sheet.
func (*XLSX) GetImageData ¶ added in v0.5.2
GetImageData returns image data as base64.
func (*XLSX) GetRowCount ¶ added in v0.5.2
GetRowCount returns the number of rows in a sheet.
func (*XLSX) GetSheetByIndex ¶ added in v0.5.3
GetSheetByIndex returns a sheet by index (1-based).
func (*XLSX) GetSheetCount ¶ added in v0.5.3
GetSheetCount returns the number of sheets.
func (*XLSX) GetSheetList ¶ added in v0.5.2
GetSheetList returns the list of sheet names.
func (*XLSX) GetSheetName ¶ added in v0.5.3
GetSheetName returns the sheet name by index (1-based).
func (*XLSX) SetCellByIndex ¶ added in v0.5.2
SetCellByIndex sets a cell value by row/col indices (1-based).
type XMLDocument ¶ added in v0.5.4
type XMLDocument struct {
// contains filtered or unexported fields
}
XMLDocument represents an XML document.
func NewXMLDocument ¶ added in v0.5.4
func NewXMLDocument() *XMLDocument
NewXMLDocument creates a new XML document.
func NewXMLDocumentWithRoot ¶ added in v0.5.4
func NewXMLDocumentWithRoot(rootName string) *XMLDocument
NewXMLDocumentWithRoot creates a new XML document with a root element.
func ParseXML ¶ added in v0.5.4
func ParseXML(xmlStr string) (*XMLDocument, error)
ParseXML parses an XML string and returns an XMLDocument.
func ParseXMLFile ¶ added in v0.5.4
func ParseXMLFile(path string) (*XMLDocument, error)
ParseXMLFile parses an XML file and returns an XMLDocument.
func (*XMLDocument) Encoding ¶ added in v0.5.4
func (d *XMLDocument) Encoding() string
Encoding returns the XML encoding.
func (*XMLDocument) Find ¶ added in v0.5.4
func (d *XMLDocument) Find(path string) *Array
Find finds nodes by path expression.
func (*XMLDocument) FindElement ¶ added in v0.5.4
func (d *XMLDocument) FindElement(path string) *XMLNode
FindElement is an alias for FindFirst.
func (*XMLDocument) FindFirst ¶ added in v0.5.4
func (d *XMLDocument) FindFirst(path string) *XMLNode
FindFirst finds the first matching node by path.
func (*XMLDocument) HashKey ¶ added in v0.5.4
func (d *XMLDocument) HashKey() HashKey
HashKey returns a hash key for the XMLDocument.
func (*XMLDocument) Inspect ¶ added in v0.5.4
func (d *XMLDocument) Inspect() string
Inspect returns a string representation.
func (*XMLDocument) Root ¶ added in v0.5.4
func (d *XMLDocument) Root() *XMLNode
Root returns the root node.
func (*XMLDocument) Save ¶ added in v0.5.4
func (d *XMLDocument) Save(path string) error
Save saves the document to a file.
func (*XMLDocument) SetRoot ¶ added in v0.5.4
func (d *XMLDocument) SetRoot(node *XMLNode)
SetRoot sets the root node.
func (*XMLDocument) ToBool ¶ added in v0.5.4
func (d *XMLDocument) ToBool() *Bool
ToBool returns true (XMLDocument is always truthy).
func (*XMLDocument) ToIndented ¶ added in v0.5.4
func (d *XMLDocument) ToIndented() string
ToIndented converts the document to indented XML string.
func (*XMLDocument) ToMap ¶ added in v0.5.4
func (d *XMLDocument) ToMap() *Map
ToMap converts the document to a Map.
func (*XMLDocument) ToString ¶ added in v0.5.4
func (d *XMLDocument) ToString() string
ToString converts the document to XML string.
func (*XMLDocument) Type ¶ added in v0.5.4
func (d *XMLDocument) Type() ObjectType
Type returns the object type.
func (*XMLDocument) TypeTag ¶ added in v0.5.4
func (d *XMLDocument) TypeTag() TypeTag
TypeTag returns the fast type tag.
func (*XMLDocument) Version ¶ added in v0.5.4
func (d *XMLDocument) Version() string
Version returns the XML version.
type XMLNode ¶ added in v0.5.4
type XMLNode struct {
// contains filtered or unexported fields
}
XMLNode represents an XML element node.
func NewXMLNode ¶ added in v0.5.4
NewXMLNode creates a new XML node.
func (*XMLNode) ChildCount ¶ added in v0.5.4
ChildCount returns the number of children.
func (*XMLNode) RemoveChild ¶ added in v0.5.4
RemoveChild removes a child node by index.
func (*XMLNode) ToIndented ¶ added in v0.5.4
ToIndented converts the node to indented XML string.
func (*XMLNode) Type ¶ added in v0.5.4
func (n *XMLNode) Type() ObjectType
Type returns the object type.
type YAMLDocument ¶ added in v0.5.10
YAMLDocument represents a YAML document that can be loaded and queried
func (*YAMLDocument) HashKey ¶ added in v0.5.10
func (y *YAMLDocument) HashKey() HashKey
HashKey returns a hash key (always 0 for YAML documents)
func (*YAMLDocument) Inspect ¶ added in v0.5.10
func (y *YAMLDocument) Inspect() string
Inspect returns a string representation
func (*YAMLDocument) ToBool ¶ added in v0.5.10
func (y *YAMLDocument) ToBool() *Bool
ToBool returns true if the document is not nil
func (*YAMLDocument) Type ¶ added in v0.5.10
func (y *YAMLDocument) Type() ObjectType
Type returns the object type
func (*YAMLDocument) TypeTag ¶ added in v0.5.10
func (y *YAMLDocument) TypeTag() TypeTag
TypeTag returns the type tag for fast type checking
Source Files
¶
- array.go
- bigfloat.go
- bigint.go
- builtin.go
- builtin_check.go
- builtin_collection.go
- builtin_compress.go
- builtin_crypto.go
- builtin_data_format.go
- builtin_db.go
- builtin_encode.go
- builtin_env.go
- builtin_file.go
- builtin_file_upload.go
- builtin_http.go
- builtin_image.go
- builtin_input.go
- builtin_json.go
- builtin_jwt.go
- builtin_mail.go
- builtin_math.go
- builtin_misc.go
- builtin_network.go
- builtin_regex.go
- builtin_string.go
- builtin_string2.go
- builtin_system.go
- builtin_system_unix.go
- builtin_task.go
- builtin_testing.go
- builtin_time.go
- builtin_unicode.go
- builtin_util.go
- builtin_xlsx.go
- bytes.go
- bytes_buffer.go
- chars.go
- class.go
- context.go
- db.go
- docx.go
- file.go
- file_lock_unix.go
- file_upload.go
- float.go
- ftp_client.go
- ftp_server.go
- function.go
- html_obj.go
- http.go
- int.go
- jsonutil.go
- line_editor.go
- map.go
- methods.go
- methods_pptx.go
- module.go
- object.go
- orderedmap.go
- pdf.go
- pinyin.go
- pinyin_data.go
- pptx.go
- qrcode.go
- queue.go
- reader_writer.go
- scanner.go
- set.go
- sftp_client.go
- sftp_server.go
- socket_addr.go
- socket_unix.go
- ssh_client.go
- string.go
- stringbuilder.go
- sync.go
- tcp_client.go
- tcp_server.go
- time_obj.go
- toml_encoder.go
- toml_lexer.go
- toml_obj.go
- toml_parser.go
- tube.go
- udp_socket.go
- udp_socket_test_new.go
- webview.go
- xlsx.go
- xml_obj.go
- yaml_obj.go