Documentation
¶
Index ¶
- Constants
- Variables
- type Kind
- type Lambda
- type Method
- type ProxyHandler
- type Value
- func (a Value) Add(others ...Value) Value
- func (v Value) Append(b []byte) []byte
- func (v Value) Array() []Value
- func (v Value) AsBytes() []byte
- func (v Value) At(path ...any) Value
- func (v Value) ByteSlice() []byte
- func (v Value) Bytes() []byte
- func (v Value) Call(name string, args ...Value) Value
- func (v Value) Capitalize(_ ...Value) Value
- func (v Value) Compact(_ ...Value) Value
- func (v Value) Delete(args ...Value) Value
- func (a Value) Div(b Value) Value
- func (v Value) EndsWith(args ...Value) Value
- func (a Value) Equal(b Value) bool
- func (a Value) Extend(b Value) Value
- func (v Value) First() Value
- func (v Value) Float() float64
- func (v Value) Get(key string) Value
- func (a Value) Greater(b Value) bool
- func (a Value) GreaterEqual(b Value) bool
- func (v Value) Has(args ...Value) Value
- func (v Value) Includes(args ...Value) Value
- func (v Value) Index(i int) Value
- func (v Value) Int() int
- func (v Value) Int64() int64
- func (v Value) Integer(_ ...Value) Value
- func (v Value) Interface() any
- func (v Value) Invoke(name string, args ...Value) Value
- func (v Value) IsArray() bool
- func (v Value) IsBlank() bool
- func (v Value) IsBool() bool
- func (v Value) IsBytes() bool
- func (v Value) IsCallable() bool
- func (v Value) IsImmediate() bool
- func (v Value) IsInvalid() bool
- func (v Value) IsIterable() bool
- func (v Value) IsMap() bool
- func (v Value) IsNil() bool
- func (v Value) IsNumber() bool
- func (v Value) IsNumeric() bool
- func (v Value) IsObject() bool
- func (v Value) IsReference() bool
- func (v Value) IsReturn() bool
- func (v Value) IsScalar() bool
- func (v Value) IsString() bool
- func (v Value) IsTrue() bool
- func (v Value) IsValid() bool
- func (v Value) ItemAt(args ...Value) Value
- func (v Value) Join(args ...Value) Value
- func (v Value) Keys(_ ...Value) Value
- func (v Value) Last() Value
- func (v Value) Len() int
- func (v Value) Length(_ ...Value) Value
- func (a Value) Less(b Value) bool
- func (a Value) LessEqual(b Value) bool
- func (v Value) Lower(_ ...Value) Value
- func (v Value) Map() map[string]Value
- func (v Value) MarshalJSON() ([]byte, error)
- func (v Value) Merge(args ...Value) Value
- func (v Value) Method(name string) (Method, bool)
- func (a Value) Mod(b Value) Value
- func (a Value) Mul(b Value) Value
- func (a Value) NotEqual(b Value) bool
- func (v Value) One() Value
- func (v Value) Pop(_ ...Value) Value
- func (v Value) Prototype(name string, fn Method)
- func (v Value) Push(args ...Value) Value
- func (v Value) Random(args ...Value) Value
- func (v Value) Replace(args ...Value) Value
- func (v Value) Reverse(_ ...Value) Value
- func (v *Value) Scan(src any) error
- func (v Value) Set(key string, val Value)
- func (v Value) Shift(_ ...Value) Value
- func (v Value) Shuffle(_ ...Value) Value
- func (v Value) Split(args ...Value) Value
- func (v Value) StartsWith(args ...Value) Value
- func (v Value) String() string
- func (a Value) Sub(b Value) Value
- func (v Value) Text() string
- func (v Value) To(target any) error
- func (v Value) ToFloat(_ ...Value) Value
- func (v Value) ToJSON() []byte
- func (v Value) ToJson(args ...Value) Value
- func (v Value) ToString(args ...Value) Value
- func (v Value) Trim(_ ...Value) Value
- func (v Value) Truthy() bool
- func (v Value) Unique(_ ...Value) Value
- func (v *Value) UnmarshalJSON(data []byte) error
- func (v Value) Unshift(args ...Value) Value
- func (v Value) Upper(_ ...Value) Value
- func (v Value) Value() (driver.Value, error)
Constants ¶
const MaxKinds = 24
MaxKinds = 24 (Tối ưu cho CPU Cache và BCE)
Variables ¶
var Methods = func() [MaxKinds]map[string]Method { var m [MaxKinds]map[string]Method for i := 0; i < MaxKinds; i++ { m[i] = make(map[string]Method) } return m }()
Methods lưu trữ phương thức động (cho phép người dùng mở rộng sau này)
Functions ¶
This section is empty.
Types ¶
type Kind ¶
type Kind uint8
Kind represents the underlying data type discriminator.
const ( Invalid Kind = iota // Internal error or uninitialized Nil // Null / undefined // --- Scalar Types (Fast-path, data stored in N) --- Number Bool Time Duration // --- Reference Types (Slow-path, data stored in V) --- String Bytes Map Array // --- Complex Types --- Struct Func Any Return Proxy )
func (Kind) Method ¶
Method tìm kiếm phương thức: Sử dụng Method Expressions để đạt hiệu năng tối đa
type ProxyHandler ¶
type ProxyHandler interface {
OnGet(key string) Value
OnCompare(op string, other Value) Value
OnInvoke(method string, args ...Value) Value
}
ProxyHandler cho phép các module khác nhau định nghĩa cách xử lý logic biểu tượng
type Value ¶
func ParseNumber ¶
ParseNumber - Chuyển chuỗi thành số thực, nạp vào trường N
func (Value) Capitalize ¶ added in v0.1.1
func (Value) GreaterEqual ¶
func (Value) IsCallable ¶
func (Value) IsImmediate ¶
func (Value) IsIterable ¶
func (Value) IsReference ¶
func (Value) MarshalJSON ¶ added in v0.1.1
MarshalJSON implements the json.Marshaler interface for Value. This ensures that when a Value is marshaled, it outputs its actual content (e.g. string, number) rather than the internal struct fields (N, V, K, S). This enables critical performance optimizations by avoiding the need to convert the entire structure to interface{} (map[string]any) before marshaling.
func (*Value) Scan ¶ added in v0.1.1
Scan implements the database/sql.Scanner interface. This allows reading SQL results directly into a Value object.
func (Value) StartsWith ¶
func (*Value) UnmarshalJSON ¶ added in v0.1.1
UnmarshalJSON implements json.Unmarshaler