Documentation
¶
Index ¶
- Constants
- Variables
- func ArgError(err error, pos int) error
- func AssertArray(input Value) error
- func AssertBinary(input Value) error
- func AssertBoolean(input Value) error
- func AssertCollection(input Value) error
- func AssertCollectionOf(ctx context.Context, input Value, assertion ValueAssertion) error
- func AssertDateTime(input Value) error
- func AssertFloat(input Value) error
- func AssertInt(input Value) error
- func AssertItemsOf(ctx context.Context, input Iterable, assertion ValueAssertion) error
- func AssertList(input Value) error
- func AssertMap(input Value) error
- func AssertMeasurable(input Value) error
- func AssertNone(input Value) error
- func AssertNumber(input Value) error
- func AssertObject(input Value) error
- func AssertString(input Value) error
- func Cast[T Value](input Value) (T, error)
- func CastArg[T Value](arg Value, index int) (T, error)
- func CastArgAt[T Value](args []Value, index int) (T, error)
- func CastArgAtOr[T Value](args []Value, index int, fallback T) (T, error)
- func CastArgs[T Value](arg []Value) ([]T, error)
- func CastArgs2[T1, T2 Value](arg1, arg2 Value) (T1, T2, error)
- func CastArgs3[T1, T2, T3 Value](arg1, arg2, arg3 Value) (T1, T2, T3, error)
- func CastArgs4[T1, T2, T3, T4 Value](arg1, arg2, arg3, arg4 Value) (T1, T2, T3, T4, error)
- func CastOr[T Value](input Value, fallback T) T
- func CastVarArgs2[T1, T2 Value](args []Value) (T1, T2, error)
- func CastVarArgs3[T1, T2, T3 Value](args []Value) (T1, T2, T3, error)
- func CastVarArgs4[T1, T2, T3, T4 Value](args []Value) (T1, T2, T3, T4, error)
- func CompareTypes(a, b Value) int
- func CompareValues(a, b Value) int
- func EncodeSortDirections(directions []SortDirection) int
- func Error(err error, msg string) error
- func Errorf(err error, format string, args ...interface{}) error
- func ForEach(ctx context.Context, input Iterable, predicate Predicate) error
- func ForEachIter(ctx context.Context, iter Iterator, predicate Predicate) error
- func GetLogger(ctx context.Context) zerolog.Logger
- func Hash(typename string, content []byte) uint64
- func IsEmpty(ctx context.Context, value Value) (bool, error)
- func IsNil(input any) bool
- func IsSameType(a, b Type) bool
- func IsType(value Value, required Type) bool
- func MapHash(input map[string]Value) uint64
- func NewLogger(opts LogSettings) zerolog.Logger
- func NumberBoundaries(input float64) (max float64, min float64)
- func NumberLowerBoundary(input float64) float64
- func NumberUpperBoundary(input float64) float64
- func Random(max float64, min float64) float64
- func Random2(mid float64) float64
- func RandomDefault() float64
- func Sort(ctx context.Context, values Value, ascending Boolean) error
- func SortAsc(ctx context.Context, values Value) error
- func SortDesc(ctx context.Context, values Value) error
- func SortList(ctx context.Context, values List, ascending Boolean) error
- func SortListAsc(ctx context.Context, values List) error
- func SortListDesc(ctx context.Context, values List) error
- func SortListWith(ctx context.Context, values List, comparator Comparator) error
- func SortSlice(values []Value, ascending Boolean)
- func SortSliceWith(values []Value, comparator Comparator)
- func TypeError(actual Type, expected ...Type) error
- func TypeErrorOf(value Value, expected ...Type) error
- func TypeName(t Type) string
- func Unwrap(val any) any
- func UnwrapAs[T any](val any) (T, bool)
- func ValidateArgType(arg Value, pos int, expected ...Type) error
- func ValidateArgTypeAt(args []Value, pos int, expected ...Type) error
- func ValidateArgValue(arg Value, pos int, assertion ValueAssertion) error
- func ValidateArgValueAt(args []Value, pos int, assertion ValueAssertion) error
- func ValidateArgs(args []Value, minimum, maximum int) error
- func ValidateArgsType(args []Value, expected ...Type) error
- func ValidateArgsValue(args []Value, assertion ValueAssertion) error
- func ValidateType(value Value, required ...Type) error
- func WithLogger(ctx context.Context, opts LogSettings) context.Context
- type Appendable
- type Array
- func (t *Array) Append(_ context.Context, value Value) error
- func (t *Array) At(_ context.Context, idx Int) (Value, error)
- func (t *Array) Clear(_ context.Context) error
- func (t *Array) Clone(ctx context.Context) (Cloneable, error)
- func (t *Array) Compare(other Value) int
- func (t *Array) Concat(ctx context.Context, other List) error
- func (t *Array) Contains(ctx context.Context, value Value) (Boolean, error)
- func (t *Array) Copy() Value
- func (t *Array) CopyWithGrowth(cap Int) *Array
- func (t *Array) Empty(_ context.Context) (List, error)
- func (t *Array) Filter(ctx context.Context, predicate IndexReadablePredicate) (List, error)
- func (t *Array) Find(ctx context.Context, predicate IndexReadablePredicate) (Value, Boolean, error)
- func (t *Array) First(_ context.Context) (Value, error)
- func (t *Array) ForEach(ctx context.Context, predicate IndexReadablePredicate) error
- func (t *Array) Hash() uint64
- func (t *Array) IndexOf(_ context.Context, item Value) (Int, error)
- func (t *Array) Insert(_ context.Context, idx Int, value Value) error
- func (t *Array) Iterate(_ context.Context) (Iterator, error)
- func (t *Array) Last(_ context.Context) (Value, error)
- func (t *Array) Length(_ context.Context) (Int, error)
- func (t *Array) LookupAt(_ context.Context, idx Int) (Value, bool, error)
- func (t *Array) Remove(ctx context.Context, value Value) error
- func (t *Array) RemoveAt(_ context.Context, idx Int) (Value, error)
- func (t *Array) SetAt(_ context.Context, idx Int, value Value) error
- func (t *Array) Slice(_ context.Context, start, end Int) (List, error)
- func (t *Array) SortAsc(ctx context.Context) error
- func (t *Array) SortDesc(ctx context.Context) error
- func (t *Array) SortWith(_ context.Context, comparator Comparator) error
- func (t *Array) String() string
- func (t *Array) Swap(_ context.Context, i, j Int) error
- func (t *Array) Type() Type
- type ArrayIterator
- type Binary
- type Boolean
- func CastBoolean(input Value) (Boolean, error)
- func IsInf(input Float, sign Int) Boolean
- func IsNaN(input Float) Boolean
- func IsNumber(input Value) Boolean
- func IsScalar(input Value) Boolean
- func MustParseBoolean(input interface{}) Boolean
- func NewBoolean(input bool) Boolean
- func ParseBoolean(input interface{}) (Boolean, error)
- func ToBoolean(input Value) Boolean
- type Box
- type Cloneable
- type Collection
- type Comparable
- type Comparator
- type Containable
- type DateTime
- func CastDateTime(input Value) (DateTime, error)
- func MustParseDateTime(input interface{}) DateTime
- func NewCurrentDateTime() DateTime
- func NewDateTime(time time.Time) DateTime
- func ParseDateTime(input interface{}) (DateTime, error)
- func ParseDateTimeWith(input interface{}, layout string) (DateTime, error)
- type DispatchEvent
- type Dispatchable
- type Float
- type FnDef
- type Function
- type Function0
- type Function1
- type Function2
- type Function3
- type Function4
- type FunctionCollection
- type FunctionConstraint
- type FunctionDefs
- type Functions
- func (f *Functions) A0() FunctionCollection[Function0]
- func (f *Functions) A1() FunctionCollection[Function1]
- func (f *Functions) A2() FunctionCollection[Function2]
- func (f *Functions) A3() FunctionCollection[Function3]
- func (f *Functions) A4() FunctionCollection[Function4]
- func (f *Functions) Has(name string) bool
- func (f *Functions) Hash() uint64
- func (f *Functions) List() []string
- func (f *Functions) Size() int
- func (f *Functions) Var() FunctionCollection[Function]
- type FunctionsBuilder
- func (b *FunctionsBuilder) A0() FnDef[Function0]
- func (b *FunctionsBuilder) A1() FnDef[Function1]
- func (b *FunctionsBuilder) A2() FnDef[Function2]
- func (b *FunctionsBuilder) A3() FnDef[Function3]
- func (b *FunctionsBuilder) A4() FnDef[Function4]
- func (b *FunctionsBuilder) Build() (*Functions, error)
- func (b *FunctionsBuilder) From(other FunctionDefs) FunctionDefs
- func (b *FunctionsBuilder) Has(name string) bool
- func (b *FunctionsBuilder) Size() int
- func (b *FunctionsBuilder) Var() FnDef[Function]
- type Hashable
- type IndexLookup
- type IndexReadable
- type IndexReadablePredicate
- type IndexRemovable
- type IndexWritable
- type Int
- func CastInt(input Value) (Int, error)
- func Length(ctx context.Context, value Value) (Int, error)
- func NewInt(input int) Int
- func NewInt64(input int64) Int
- func ParseInt(input interface{}) (Int, error)
- func ToInt(ctx context.Context, input Value) (Int, error)
- func ToIntDefault(ctx context.Context, input Value, defaultValue Int) (Int, error)
- func ToIntSafe(ctx context.Context, input Value) Int
- type Iterable
- type Iterator
- type KeyLookup
- type KeyReadable
- type KeyReadablePredicate
- type KeyRemovable
- type KeyWritable
- type Library
- type List
- type ListStorage
- type LogLevel
- type LogSettings
- type Map
- type MapStorage
- type Measurable
- type Message
- type Namespace
- type Object
- func (t *Object) Clear(_ context.Context) error
- func (t *Object) Clone(ctx context.Context) (Cloneable, error)
- func (t *Object) Compare(other Value) int
- func (t *Object) Contains(_ context.Context, target Value) (Boolean, error)
- func (t *Object) ContainsKey(_ context.Context, key Value) (Boolean, error)
- func (t *Object) Copy() Value
- func (t *Object) Empty(_ context.Context) (Map, error)
- func (t *Object) Filter(ctx context.Context, predicate KeyReadablePredicate) (List, error)
- func (t *Object) Find(ctx context.Context, predicate KeyReadablePredicate) (Value, Boolean, error)
- func (t *Object) ForEach(ctx context.Context, predicate KeyReadablePredicate) error
- func (t *Object) Get(_ context.Context, key Value) (Value, error)
- func (t *Object) Hash() uint64
- func (t *Object) IsEmpty(_ context.Context) (Boolean, error)
- func (t *Object) Iterate(_ context.Context) (Iterator, error)
- func (t *Object) Keys(_ context.Context) (List, error)
- func (t *Object) Length(_ context.Context) (Int, error)
- func (t *Object) Lookup(_ context.Context, key Value) (Value, bool, error)
- func (t *Object) Merge(ctx context.Context, other Map) error
- func (t *Object) ObjectLike()
- func (t *Object) Remove(_ context.Context, value Value) error
- func (t *Object) RemoveKey(_ context.Context, key Value) error
- func (t *Object) Set(_ context.Context, key, value Value) error
- func (t *Object) String() string
- func (t *Object) Type() Type
- func (t *Object) Values(_ context.Context) (List, error)
- type ObjectIterator
- type ObjectLike
- type Observable
- type Params
- func (p Params) Clone() Params
- func (p Params) Delete(name string)
- func (p Params) Get(name string) (Value, bool)
- func (p Params) GetOr(name string, fallback Value) Value
- func (p Params) Has(name string) bool
- func (p Params) Merge(other Params) Params
- func (p Params) MustGet(name string) Value
- func (p Params) MustSet(name string, value any) Params
- func (p Params) Set(name string, value any) error
- func (p Params) SetAll(values map[string]any) error
- func (p Params) SetAllValues(values map[string]Value) Params
- func (p Params) SetValue(name string, value Value) Params
- type Predicate
- type Query
- type Queryable
- type Range
- func (r *Range) Compare(_ context.Context, other Value) (int, error)
- func (r *Range) Copy() Value
- func (r *Range) End() Int
- func (r *Range) Hash() uint64
- func (r *Range) Iterate(_ context.Context) (Iterator, error)
- func (r *Range) MarshalJSON() ([]byte, error)
- func (r *Range) Start() Int
- func (r *Range) String() string
- type RangeIterator
- type Resource
- type SortDirection
- type SortLess
- type SortSwap
- type Sortable
- type Spawnable
- type StateManagerFactory
- type StorageManager
- type Stream
- type StreamIterator
- type String
- func (s String) At(index Int) String
- func (s String) Compare(other Value) int
- func (s String) Concat(other Value) String
- func (s String) Contains(other String) Boolean
- func (s String) Copy() Value
- func (s String) Hash() uint64
- func (s String) IndexOf(other String) Int
- func (s String) Length(_ context.Context) (Int, error)
- func (s String) String() string
- func (s String) Type() Type
- func (s String) Unwrap() any
- type Subscription
- type Type
- type TypeMatcher
- type Typed
- type Unwrappable
- type Value
- func Add(_ context.Context, inputL, inputR Value) Value
- func AddLeftFloat(float Float, input Value) Value
- func AddLeftInt(integer Int, input Value) Value
- func CloneOrCopy(ctx context.Context, val Value) (Value, error)
- func Decrement(ctx context.Context, input Value) Value
- func Divide(ctx context.Context, inputL, inputR Value) Value
- func Increment(ctx context.Context, input Value) Value
- func Modulus(ctx context.Context, inputL, inputR Value) Value
- func Multiply(ctx context.Context, inputL, inputR Value) Value
- func Parse(input any) Value
- func Subtract(ctx context.Context, inputL, inputR Value) Value
- func ToNumberOnly(ctx context.Context, input Value) Value
- func ToNumberOrString(input Value) Value
- func ValueOf(input any) (Value, error)
- type ValueAssertion
- type ValueRemovable
- type ValueStorage
Constants ¶
const ( False = Boolean(false) True = Boolean(true) )
const ( EmptyString = String("") SpaceString = String(" ") )
const DefaultStreamTimeout = 5000
const DefaultTimeLayout = time.RFC3339
const MaxArgs = 65536
MaxArgs defines the maximum number of arguments that a function can accept.
const NamespaceSeparator = "::"
const (
UnknownTypeName = "Unknown"
)
const (
ZeroFloat = Float(0.0)
)
const (
ZeroInt = Int(0)
)
Variables ¶
var ( ErrMissedArgument = errors.New("missed argument") ErrInvalidArgument = errors.New("invalid argument") ErrInvalidArgumentNumber = errors.New("invalid argument number") ErrInvalidArgumentType = errors.New("invalid argument type") ErrInvalidType = errors.New("invalid type") ErrInvalidOperation = errors.New("invalid operation") ErrNotFound = errors.New("not found") ErrNotUnique = errors.New("not unique") ErrUnexpected = errors.New("unexpected error") ErrTimeout = errors.New("operation timed out") ErrNotImplemented = errors.New("not implemented") ErrNotSupported = errors.New("not supported") )
var ( // Actual types TypeNone = newBuiltinType("None", func(v Value) bool { return v == None || v == nil }) TypeBoolean = newBuiltinType("Boolean", func(v Value) bool { _, ok := v.(Boolean) return ok }) TypeInt = newBuiltinType("Int", func(v Value) bool { _, ok := v.(Int) return ok }) TypeFloat = newBuiltinType("Float", func(v Value) bool { _, ok := v.(Float) return ok }) TypeString = newBuiltinType("String", func(v Value) bool { _, ok := v.(String) return ok }) TypeDateTime = newBuiltinType("DateTime", func(v Value) bool { _, ok := v.(DateTime) return ok }) TypeArray = newBuiltinType("Array", func(v Value) bool { _, ok := v.(*Array) return ok }) TypeObject = newBuiltinType("Object", func(v Value) bool { _, ok := v.(ObjectLike) return ok }) TypeBinary = newBuiltinType("Binary", func(v Value) bool { _, ok := v.(Binary) return ok }) // Interfaces TypeCollection = newBuiltinType("Collection", func(v Value) bool { _, ok := v.(Collection) return ok }) TypeList = newBuiltinType("List", func(v Value) bool { _, ok := v.(List) return ok }) TypeMap = newBuiltinType("Map", func(v Value) bool { _, ok := v.(Map) return ok }) // Capabilities TypeIndexReadable = newBuiltinType("IndexReadable", func(v Value) bool { _, ok := v.(IndexReadable) return ok }) TypeIndexRemovable = newBuiltinType("IndexRemovable", func(v Value) bool { _, ok := v.(IndexRemovable) return ok }) TypeIndexWritable = newBuiltinType("IndexWritable", func(v Value) bool { _, ok := v.(IndexWritable) return ok }) TypeKeyReadable = newBuiltinType("KeyReadable", func(v Value) bool { _, ok := v.(KeyReadable) return ok }) TypeKeyWritable = newBuiltinType("KeyWritable", func(v Value) bool { _, ok := v.(KeyWritable) return ok }) TypeKeyRemovable = newBuiltinType("KeyRemovable", func(v Value) bool { _, ok := v.(KeyRemovable) return ok }) TypeValueRemovable = newBuiltinType("ValueRemovable", func(v Value) bool { _, ok := v.(ValueRemovable) return ok }) TypeAppendable = newBuiltinType("Appendable", func(v Value) bool { _, ok := v.(Appendable) return ok }) TypeContainable = newBuiltinType("Containable", func(v Value) bool { _, ok := v.(Containable) return ok }) TypeIterable = newBuiltinType("Iterable", func(v Value) bool { _, ok := v.(Iterable) return ok }) TypeIterator = newBuiltinType("Iterator", func(v Value) bool { _, ok := v.(Iterator) return ok }) TypeMeasurable = newBuiltinType("Measurable", func(v Value) bool { _, ok := v.(Measurable) return ok }) TypeComparable = newBuiltinType("Comparable", func(v Value) bool { _, ok := v.(Comparable) return ok }) TypeCloneable = newBuiltinType("Cloneable", func(v Value) bool { _, ok := v.(Cloneable) return ok }) TypeSortable = newBuiltinType("Sortable", func(v Value) bool { _, ok := v.(Sortable) return ok }) TypeDispatchable = newBuiltinType("Dispatchable", func(v Value) bool { _, ok := v.(Dispatchable) return ok }) TypeObservable = newBuiltinType("Observable", func(v Value) bool { _, ok := v.(Observable) return ok }) TypeQueryable = newBuiltinType("Queryable", func(v Value) bool { _, ok := v.(Queryable) return ok }) )
var (
None = &none{}
)
var NoopIterator = noopIterator{}
var ZeroDateTime = DateTime{ time.Time{}, }
Functions ¶
func ArgError ¶
ArgError creates an error for an invalid argument at the specified position. The position is 0-based internally but reported as 1-based to users.
func AssertArray ¶
func AssertBinary ¶
func AssertBoolean ¶
func AssertCollection ¶
func AssertCollectionOf ¶
func AssertCollectionOf(ctx context.Context, input Value, assertion ValueAssertion) error
func AssertDateTime ¶
func AssertFloat ¶
func AssertItemsOf ¶
func AssertItemsOf(ctx context.Context, input Iterable, assertion ValueAssertion) error
func AssertList ¶
func AssertMeasurable ¶
func AssertNone ¶
func AssertNumber ¶
func AssertObject ¶
func AssertString ¶
func Cast ¶
Cast attempts to cast the input value to the specified type T. If successful, it returns the value and nil error. If the cast fails, it returns the zero value of type T and a TypeError indicating the mismatch.
func CastArg ¶
CastArg attempts to cast a given Value to the specified type T. Returns the casted value and nil error if the type assertion succeeds, otherwise the zero value of T and an error.
func CastArgAt ¶
CastArgAt attempts to cast an argument from the args slice at the specified index to type T. Returns the casted value and nil error if successful, otherwise the zero value of type T and an error.
func CastArgAtOr ¶
CastArgAtOr attempts to cast the argument at the specified index to type T. Returns the casted value if successful or the provided fallback value if the index is out of range.
func CastArgs ¶
CastArgs attempts to cast a slice of Value to a slice of a specified type T. Returns the slice of casted values and nil error if all casts succeed, otherwise nil and an error.
func CastArgs2 ¶
CastArgs2 attempts to cast two Values to the specified types T1 and T2. Returns the casted values and nil error if the type assertions succeed; otherwise, returns zero values of T1 and T2 along with an error.
func CastArgs3 ¶
CastArgs3 attempts to cast three Values to the specified types T1, T2, and T3. Returns the casted values and nil error if the type assertions succeed; otherwise, returns zero values of T1, T2, and T3 along with an error.
func CastArgs4 ¶
CastArgs4 attempts to cast four Values to the specified types T1, T2, T3, and T4. Returns the casted values and nil error if the type assertions succeed; otherwise, returns zero values of T1, T2, T3, and T4 along with an error.
func CastOr ¶
CastOr attempts to cast the input value to the specified type T. If the cast is successful, it returns the casted value. Otherwise, it returns the provided fallback value.
func CastVarArgs2 ¶
CastVarArgs2 attempts to cast the first two elements of the args slice to the specified types T1 and T2. It first validates that the number of arguments is between 2 and MaxArgs. If validation fails, it returns zero values of T1 and T2 along with the error. If validation succeeds, it attempts to cast the first two arguments to T1 and T2 respectively, returning any errors encountered during casting.
func CastVarArgs3 ¶
CastVarArgs3 attempts to cast the first three elements of the args slice to the specified types T1, T2, and T3. It first validates that the number of arguments is between 3 and MaxArgs. If validation fails, it returns zero values of T1, T2, and T3 along with the error. If validation succeeds, it attempts to cast the first three arguments to T1, T2, and T3 respectively, returning any errors encountered during casting.
func CastVarArgs4 ¶
CastVarArgs4 attempts to cast the first four elements of the args slice to the specified types T1, T2, T3, and T4. It first validates that the number of arguments is between 4 and MaxArgs. If validation fails, it returns zero values of T1, T2, T3, and T4 along with the error. If validation succeeds, it attempts to cast the first four arguments to T1, T2, T3, and T4 respectively, returning any errors encountered during casting.
func CompareTypes ¶
CompareTypes compares the types of two values and returns -1 if a < b, 0 if a == b, and 1 if a > b.
func CompareValues ¶
func EncodeSortDirections ¶
func EncodeSortDirections(directions []SortDirection) int
EncodeSortDirections encodes a slice of SortDirection values into a single integer by combining their bit representations.
func Error ¶
Error creates a new error by wrapping the provided error with the given message. The resulting error will include both the original error and the additional message, providing more context about the error.
func Errorf ¶
Errorf creates a new error by wrapping the provided error with a formatted message. The resulting error will include both the original error and the formatted message, providing more context about the error.
func Hash ¶
Hash computes a hash value for the given typename and content using the FNV-1a hashing algorithm. It concatenates the typename, a colon, and the content bytes to generate a unique hash value. This function can be used to create consistent hash values for different types of content based on their type and content.
func IsSameType ¶
IsSameType checks if two Types are the same, considering nil as a valid type that can be compared. It returns true if both types are nil or if they are the same non-nil type, and false otherwise. This function is used in IsType to quickly check for type equality before falling back to Is checks, and it allows for nil types to be compared without causing a panic. For example, IsSameType(nil, nil) returns true, IsSameType(nil, TypeInt) returns false, and IsSameType(TypeInt, TypeInt) returns true. Note that IsSameType only checks for direct type equality and does not consider interface conformance or Typed overrides, which is why IsType uses it as a first check before calling required.Is(value).
func IsType ¶
IsType reports whether a value matches the required type. It uses TypeOf first (respecting Typed overrides) and then checks required.Is.
func MapHash ¶
MapHash computes a hash value for a map of string keys to Value values. It uses the FNV-1a hashing algorithm to generate a consistent hash based on the keys and their corresponding value hashes. The keys are sorted to ensure that the order of key-value pairs does not affect the resulting hash.
func NewLogger ¶
func NewLogger(opts LogSettings) zerolog.Logger
func NumberBoundaries ¶
func NumberLowerBoundary ¶
func NumberUpperBoundary ¶
func RandomDefault ¶
func RandomDefault() float64
func SortListAsc ¶
func SortListDesc ¶
func SortListWith ¶
func SortListWith(ctx context.Context, values List, comparator Comparator) error
SortListWith sorts the given List using the stable Sort algorithm using a custom comparator
func SortSliceWith ¶
func SortSliceWith(values []Value, comparator Comparator)
func TypeError ¶
TypeError creates a new error indicating that the provided type is invalid. The expected parameter can be used to specify one or more expected types for the value.
func TypeErrorOf ¶
TypeErrorOf creates a new error indicating that the provided value has an invalid type. The expected parameter can be used to specify one or more expected types for the value.
func Unwrap ¶
Unwrap attempts to unwrap the given value if it implements the Unwrappable interface. If the value does not implement Unwrappable, it returns nil.
func UnwrapAs ¶
UnwrapAs attempts to unwrap the given value if it implements the Unwrappable interface and checks if the unwrapped value is of type T. If the value does not implement Unwrappable or the unwrapped value is not of type T, it returns the zero value of T and false.
func ValidateArgType ¶
ValidateArgType validates that the provided argument matches one of the expected types. It returns an error if the argument does not match any of the expected types, indicating the position of the invalid argument.
func ValidateArgTypeAt ¶
ValidateArgTypeAt checks if the argument at the specified position matches one of the expected types. Returns an error if the position is out of bounds or if the argument does not match any of the expected types.
func ValidateArgValue ¶
func ValidateArgValue(arg Value, pos int, assertion ValueAssertion) error
ValidateArgValue asserts that each argument in the provided slice satisfies the given value assertion. It returns an error if any argument does not satisfy the value assertion, indicating the position of the invalid argument.
func ValidateArgValueAt ¶
func ValidateArgValueAt(args []Value, pos int, assertion ValueAssertion) error
ValidateArgValueAt checks if the argument at the specified position satisfies the given assertion function. Returns an error if the position is out of bounds or if the assertion fails.
func ValidateArgs ¶
ValidateArgs validates that the number of arguments is within the specified range. It returns an error if the argument count is outside the [minimum, maximum] range.
func ValidateArgsType ¶
ValidateArgsType validates that each argument in the provided slice matches at least one of the expected types. It returns an error if any argument does not match any of the expected types, indicating the position of the invalid argument. The position is 0-based internally but reported as 1-based to users.
func ValidateArgsValue ¶
func ValidateArgsValue(args []Value, assertion ValueAssertion) error
ValidateArgsValue validates that each argument in the provided slice satisfies the given value assertion. It returns an error if any argument does not satisfy the value assertion, indicating the position of the invalid argument.
func ValidateType ¶
ValidateType checks whether a value matches any of the required types and returns an error if it doesn't. It uses IsType, so interface conformance and Typed overrides are accepted.
func WithLogger ¶
func WithLogger(ctx context.Context, opts LogSettings) context.Context
Types ¶
type Appendable ¶
type Appendable interface {
// Append appends the given value to the end of the collection or returns an error if the operation fails.
Append(ctx context.Context, val Value) error
}
Appendable is an interface for adding elements to a collection-like structure that supports indexing.
type Array ¶
type Array struct {
// contains filtered or unexported fields
}
func EmptyArray ¶
func EmptyArray() *Array
func NewArray64 ¶
func NewArrayOf ¶
func NewArrayWith ¶
func NewSizedArray ¶
func (*Array) CopyWithGrowth ¶
func (*Array) Filter ¶
func (t *Array) Filter(ctx context.Context, predicate IndexReadablePredicate) (List, error)
type ArrayIterator ¶
type ArrayIterator struct {
// contains filtered or unexported fields
}
type Binary ¶
type Binary []byte
func CastBinary ¶
func ToBinary ¶
ToBinary attempts to convert an arbitrary Value into a Binary type. If the input is already a Binary, it returns it directly. For other types, it converts the input to its string representation and then to a byte slice to create a new Binary. This allows for flexible conversion of various Value types into a Binary format, using their string representation as the basis for the binary data.
type Boolean ¶
type Boolean bool
func CastBoolean ¶
func IsNumber ¶
IsNumber checks if the input Value is of type Int or Float, indicating that it is a numeric type.
func IsScalar ¶
IsScalar checks if the input Value is of a scalar type (Int, Float, String, or Boolean).
func MustParseBoolean ¶
func MustParseBoolean(input interface{}) Boolean
func NewBoolean ¶
func ParseBoolean ¶
type Box ¶
type Box[T any] struct { Value T }
Box is a generic container that holds a single value of type T. Useful for wrapping values that do not implement the Value interface, allowing them to be used in contexts where a Value is expected.
type Cloneable ¶
type Cloneable interface {
Value
// Clone creates a deep copy of the value.
Clone(ctx context.Context) (Cloneable, error)
}
Cloneable represents an interface of a value that can be cloned. The difference between Copy and Clone is that Copy returns a shallow copy of the value and Clone returns a deep copy of the value.
func CastCloneable ¶
type Collection ¶
type Collection interface {
Value
Containable
Comparable
Measurable
Cloneable
Iterable
// Clear removes all elements from the collection or returns an error if the operation fails.
Clear(ctx context.Context) error
}
Collection represents a collection of values. Generic interface for all collection-like structures.
func CastCollection ¶
type Comparable ¶
func CastComparable ¶
func CastComparable(input Value) (Comparable, error)
type Comparator ¶
type Containable ¶
type Containable interface {
// Contains method checks if the given value exists in the collection and returns a boolean result or an error if the operation fails.
Contains(ctx context.Context, value Value) (Boolean, error)
}
Containable is an interface for checking the presence of a value in a collection-like structure.
type DateTime ¶
func CastDateTime ¶
func MustParseDateTime ¶
func MustParseDateTime(input interface{}) DateTime
func NewCurrentDateTime ¶
func NewCurrentDateTime() DateTime
func NewDateTime ¶
func ParseDateTime ¶
func ParseDateTimeWith ¶
type DispatchEvent ¶
type DispatchEvent struct {
Payload Value `json:"payload"`
Options Value `json:"options"`
Name String `json:"name"`
}
DispatchEvent represents an event that can be dispatched by a Dispatchable entity.
type Dispatchable ¶
type Dispatchable interface {
Dispatch(ctx context.Context, event DispatchEvent) (Value, error)
}
Dispatchable represents an entity that can dispatch events.
type Float ¶
type Float float64
func MustParseFloat ¶
func MustParseFloat(input interface{}) Float
func ParseFloat ¶
type FnDef ¶
type FnDef[T FunctionConstraint] interface { // Add adds a function to the builder. // If a function with the same name already exists, it will be ignored and an error will be recorded. Add(name string, fn T) FnDef[T] // Remove removes a function from the builder. // If a function with the same name does not exist, an error will be recorded. Remove(name string) FnDef[T] // Has checks if a function with the given name exists in the builder. Has(name string) bool // List retrieves the names of all functions currently registered in the builder. List() []string // ForEach iterates over all registered functions, calling the provided function with each function and its name. // Iteration stops if the provided function returns false. ForEach(fn func(fn T, name string) bool) }
type Function ¶
Function is a common interface for functions with variable number of arguments. All functions receive a context and a slice of values, returning a value and an error.
type FunctionCollection ¶
type FunctionCollection[T FunctionConstraint] interface { Has(name string) bool Get(name string) (T, bool) GetAll() map[string]T Names() []string Size() int ForEach(fn func(T, string) bool) }
FunctionCollection is an immutable collection of functions of a specific type (e.g., Function, Function0, etc.)
func NewFunctionCollection ¶
func NewFunctionCollection[T FunctionConstraint]() FunctionCollection[T]
NewFunctionCollection creates a new function collection of the specified type
func NewFunctionCollectionFromMap ¶
func NewFunctionCollectionFromMap[T FunctionConstraint](values map[string]T) FunctionCollection[T]
NewFunctionCollectionFromMap creates a new function collection from an existing map It makes a copy of the provided map to ensure that the original map remains unmodified
type FunctionConstraint ¶
type FunctionConstraint interface {
Function | Function0 | Function1 | Function2 | Function3 | Function4
}
FunctionConstraint is a type constraint that includes all function types
type FunctionDefs ¶
type FunctionDefs interface {
// Size returns the total number of function definitions present in the collection.
Size() int
// Has checks if an entity with the given name exists in the collection and returns true if found, false otherwise.
Has(name string) bool
// A0 returns a function definition interface for managing functions with 0 arguments.
A0() FnDef[Function0]
// A1 returns a function definition interface for managing functions with 1 argument.
A1() FnDef[Function1]
// A2 returns a function definition interface for managing functions with 2 arguments.
A2() FnDef[Function2]
// A3 returns a function definition interface for managing functions with 3 arguments.
A3() FnDef[Function3]
// A4 returns a function definition interface for managing functions with 4 arguments.
A4() FnDef[Function4]
// Var returns a function definition interface for managing dynamic functions with variable arguments.
Var() FnDef[Function]
// From initializes the builder with functions from the given Functions container.
From(other FunctionDefs) FunctionDefs
}
type Functions ¶
type Functions struct {
// contains filtered or unexported fields
}
Functions is a container for functions that organizes them by their argument count. It provides separate storage for functions with fixed argument counts (0-4) and functions with variable argument counts for optimal performance.
func NewFunctions ¶
func NewFunctions() *Functions
NewFunctions creates and returns a new empty Functions container.
func NewFunctionsFrom ¶
func (*Functions) A0 ¶
func (f *Functions) A0() FunctionCollection[Function0]
func (*Functions) A1 ¶
func (f *Functions) A1() FunctionCollection[Function1]
func (*Functions) A2 ¶
func (f *Functions) A2() FunctionCollection[Function2]
func (*Functions) A3 ¶
func (f *Functions) A3() FunctionCollection[Function3]
func (*Functions) A4 ¶
func (f *Functions) A4() FunctionCollection[Function4]
func (*Functions) Var ¶
func (f *Functions) Var() FunctionCollection[Function]
type FunctionsBuilder ¶
type FunctionsBuilder struct {
FunctionDefs
// contains filtered or unexported fields
}
func NewFunctionsBuilder ¶
func NewFunctionsBuilder() *FunctionsBuilder
func NewFunctionsBuilderFrom ¶
func NewFunctionsBuilderFrom(funcs ...*Functions) *FunctionsBuilder
type Hashable ¶
type Hashable interface {
// Hash returns a hash value for the object.
Hash() uint64
}
Hashable represents an interface of any type that can be hashed.
type IndexLookup ¶
type IndexLookup interface {
// LookupAt returns the value at index.
// It returns found=false, err=nil when the index does not exist.
// It returns a non-nil error only if the lookup itself fails.
LookupAt(ctx context.Context, index Int) (Value, bool, error)
}
IndexLookup provides safe indexed access to a value.
type IndexReadable ¶
type IndexReadable interface {
// At retrieves the value at the given index or returns an error if the index is invalid.
At(ctx context.Context, idx Int) (Value, error)
}
IndexReadable is an interface for accessing elements by their index in a collection-like structure.
type IndexReadablePredicate ¶
IndexReadablePredicate is a function type that represents a condition to be evaluated against elements in a collection based on their index.
type IndexRemovable ¶
type IndexRemovable interface {
// RemoveAt method removes the value at the given index and returns it or returns an error if the index is invalid.
RemoveAt(ctx context.Context, idx Int) (Value, error)
}
IndexRemovable is an interface for removing elements by their index in a collection-like structure.
type IndexWritable ¶
type IndexWritable interface {
// SetAt method updates the value at the given index or returns an error if the index is invalid.
SetAt(ctx context.Context, idx Int, value Value) error
}
IndexWritable is an interface for modifying elements by their index in a collection-like structure.
type Int ¶
type Int int64
func ToIntDefault ¶
ToIntDefault attempts to convert an arbitrary Value into an Int. If the conversion fails or if the resulting Int is not greater than zero, it returns the provided defaultValue. This function is useful for safely converting values to Int while providing a fallback option in case of errors or non-positive results.
type Iterable ¶
Iterable represents an interface of a value that can be iterated by using an iterator.
type Iterator ¶
Iterator represents an interface of an iterator. Next must return io.EOF when the iterator is exhausted.
func NewArrayIterator ¶
func NewObjectIterator ¶
func NewRangeIterator ¶
func NewStreamIterator ¶
type KeyLookup ¶
type KeyLookup interface {
// Lookup returns the value associated with key.
// It returns found=false, err=nil when the key does not exist.
// It returns a non-nil error only if the lookup itself fails.
Lookup(ctx context.Context, key Value) (Value, bool, error)
}
KeyLookup provides safe keyed access to a value.
type KeyReadable ¶
type KeyReadable interface {
// Get retrieves the value associated with the given key.
// Implementations may represent missing keys as (None, nil), or return an error for backends
// where lookup itself can fail (for example remote/IO-backed stores).
Get(ctx context.Context, key Value) (Value, error)
}
KeyReadable is an interface for accessing elements by their key in a collection-like structure.
type KeyReadablePredicate ¶
KeyReadablePredicate is a function type that represents a condition to be evaluated against elements in a collection based on their key.
type KeyRemovable ¶
type KeyRemovable interface {
// RemoveKey removes the value associated with the specified key from the collection or returns an error if the operation fails.
RemoveKey(ctx context.Context, key Value) error
}
KeyRemovable is an interface for removing elements by their key in a collection-like structure.
type KeyWritable ¶
type KeyWritable interface {
// Set method sets or updates the value associated with the given key or returns an error if the operation fails.
Set(ctx context.Context, key, value Value) error
}
KeyWritable is an interface for modifying elements by their key in a collection-like structure.
type Library ¶
type Library interface {
Namespace
// Size returns the total number of elements or entities in the collection or namespace.
Size() int
// Build constructs and returns a finalized Functions instance or an error if the build process fails.
Build() (*Functions, error)
}
Library represents a collection of functions organized in namespaces. It provides methods to create nested namespaces and register functions within those namespaces, as well as a method to build the final Functions instance.
func NewLibrary ¶
func NewLibrary() Library
type List ¶
type List interface {
Collection
Sortable
Appendable
IndexReadable
IndexLookup
IndexWritable
IndexRemovable
ValueRemovable
Spawnable[List]
// Insert adds a value at the specified index in a collection or returns an error if the index is invalid or operation fails.
Insert(ctx context.Context, idx Int, value Value) error
// Swap exchanges the values at two specified indices in a collection or returns an error if indices are invalid or operation fails.
Swap(ctx context.Context, a, b Int) error
// Concat concatenates another list to the current list or returns an error if the operation fails.
Concat(ctx context.Context, other List) error
// Filter creates a new list containing elements that satisfy the given predicate or returns an error if filtering fails.
Filter(ctx context.Context, predicate IndexReadablePredicate) (List, error)
// Find searches for the first element in the list that satisfies the given predicate or returns an error if search fails.
Find(ctx context.Context, predicate IndexReadablePredicate) (Value, Boolean, error)
// IndexOf returns the index of the first occurrence of the specified value in the list or -1 if not found.
IndexOf(ctx context.Context, value Value) (Int, error)
// First retrieves the first element of the collection or returns an error if the collection is empty or inaccessible.
First(ctx context.Context) (Value, error)
// Last retrieves the last element of the collection or returns an error if the collection is empty or inaccessible.
Last(ctx context.Context) (Value, error)
// Slice returns a new list containing elements from the specified range or returns an error if range is invalid or inaccessible.
Slice(ctx context.Context, start, end Int) (List, error)
// ForEach iterates over each element in the list and applies the given predicate function or returns an error if iteration fails.
ForEach(ctx context.Context, predicate IndexReadablePredicate) error
}
List represents a items of values. Generic interface for all items-like structures.
func ToList ¶
ToList attempts to convert an arbitrary Value into a List type. It supports basic types like Boolean, Int, Float, String, DateTime by wrapping them into a single-element List. For List types, it returns a copy of the List. For Iterable types, it iterates through the elements and appends them to a new List. For unsupported types, it returns an empty List.
type ListStorage ¶
type LogSettings ¶
type Map ¶
type Map interface {
Collection
KeyReadable
KeyLookup
KeyWritable
KeyRemovable
ValueRemovable
Spawnable[Map]
// Merge merges another map into the current map, combining their key-value pairs or returns an error if merging fails.
Merge(ctx context.Context, other Map) error
// ContainsKey checks if the map contains the specified key or returns an error if key check fails.
ContainsKey(ctx context.Context, key Value) (Boolean, error)
// Keys returns a list of all keys in the map or an error if retrieval fails.
Keys(ctx context.Context) (List, error)
// Values returns a list of all values in the map or an error if retrieval fails.
Values(ctx context.Context) (List, error)
// Filter returns a list of values that satisfy the given predicate or an error if filtering fails.
Filter(ctx context.Context, predicate KeyReadablePredicate) (List, error)
// Find searches for the first value in the map that satisfies the given predicate or returns an error if search fails.
Find(ctx context.Context, predicate KeyReadablePredicate) (Value, Boolean, error)
// ForEach iterates over each key-value pair in the map and applies the given predicate function or returns an error if iteration fails.
ForEach(ctx context.Context, predicate KeyReadablePredicate) error
}
Map represents a dictionary of values. Generic interface for all dictionary-like structures.
func ToMap ¶
ToMap attempts to convert an arbitrary Value into a Map type. It supports Map, Array, and Iterable types, converting them into a Map format. For unsupported types, it returns an empty Map. The function uses the string representation of keys for Arrays and Iterables, with array indices as keys for Arrays.
type MapStorage ¶
type MapStorage interface {
Iterable
Measurable
KeyReadable
KeyWritable
}
type Message ¶
type Message interface {
// Value returns a value of the message.
Value() Value
// Err returns an error of the message.
Err() error
}
Message represents an event message that an Observable can emit.
func NewErrorMessage ¶
NewErrorMessage creates a new Message with an error.
func NewValueMessage ¶
NewValueMessage creates a new Message with a value.
type Namespace ¶
type Namespace interface {
// Namespace creates a new nested namespace with the given name and returns it.
Namespace(name string) Namespace
// Function returns a FunctionDefs interface that allows registering functions within this namespace.
Function() FunctionDefs
}
Namespace represents a namespace that can contain functions and nested namespaces. It provides methods to create nested namespaces and register functions within those namespaces.
func NewNamespace ¶
type Object ¶
type Object struct {
// contains filtered or unexported fields
}
func CastObject ¶
func NewObjectOf ¶
func NewObjectWith ¶
NewObjectWith creates a new object with the provided properties. The properties are copied to ensure that the original map can be safely modified without affecting the created object.
func (*Object) Compare ¶
Compare compares the source object with other core.Value The behavior of the Compare is similar to the comparison of objects in ArangoDB
func (*Object) ContainsKey ¶
func (*Object) Filter ¶
func (t *Object) Filter(ctx context.Context, predicate KeyReadablePredicate) (List, error)
func (*Object) ForEach ¶
func (t *Object) ForEach(ctx context.Context, predicate KeyReadablePredicate) error
func (*Object) ObjectLike ¶
func (t *Object) ObjectLike()
type ObjectIterator ¶
type ObjectIterator struct {
// contains filtered or unexported fields
}
type ObjectLike ¶
type ObjectLike interface {
Map
ObjectLike()
}
ObjectLike marks values that should be treated as TypeObject. It allows VM-internal object implementations to participate in object-specific checks without being in the runtime package.
type Observable ¶
type Observable interface {
Subscribe(ctx context.Context, subscription Subscription) (Stream, error)
}
Observable represents an interface of complex types that returns stream of events.
type Params ¶
func NewParamsFrom ¶
NewParamsFrom constructs a Params object from a map of string keys to any values, converting each value to a Value.
type Predicate ¶
Predicate is a function type that represents a condition to be evaluated against elements in a collection.
type Query ¶
type Query struct {
Options Value `json:"options"`
Kind String `json:"kind"`
Payload String `json:"payload"`
}
Query represents a query literal used by the operator index.
type Range ¶
type Range struct {
// contains filtered or unexported fields
}
func (*Range) MarshalJSON ¶
type RangeIterator ¶
type RangeIterator struct {
// contains filtered or unexported fields
}
type Resource ¶
Resource represents a runtime-managed entity that participates in VM ownership tracking and must be closable. ResourceID must be stable for the lifetime of the live resource and unique among concurrently tracked resources.
type SortDirection ¶
type SortDirection = Int
SortDirection represents the sorting direction, either ascending or descending.
const ( SortDirectionAsc SortDirection = iota // Ascending sort direction SortDirectionDesc // Descending sort direction )
func DecodeSortDirections ¶
func DecodeSortDirections(encoded int, count int) []SortDirection
DecodeSortDirections decodes an integer into a slice of SortDirection values representing sorting directions. The number of decoded directions is determined by the count argument. Each bit of the encoded integer corresponds to a SortDirection value in the resulting slice.
func NewSortDirection ¶
func NewSortDirection(direction Int) SortDirection
type Sortable ¶
type Sortable interface {
// SortAsc sorts the collection in ascending order.
SortAsc(context.Context) error
// SortDesc sorts the collection in descending order.
SortDesc(context.Context) error
}
Sortable is an interface that defines methods for sorting a collection of values.
type Spawnable ¶
type Spawnable[T any] interface { // Empty creates a new instance of the type or returns an error if the operation fails. // The new instance should be initialized with default values and ready for use. Empty(ctx context.Context) (T, error) }
Spawnable is an interface for creating new instances of a type. Generic interface for all types that can create new instances of themselves.
type StateManagerFactory ¶
type StateManagerFactory interface {
New(ctx context.Context) (StorageManager, error)
}
type StorageManager ¶
type StreamIterator ¶
type StreamIterator struct {
// contains filtered or unexported fields
}
func (*StreamIterator) Close ¶
func (s *StreamIterator) Close() error
type String ¶
type String string
func CastString ¶
func MustParseString ¶
func MustParseString(input interface{}) String
func NewStringFromRunes ¶
func ParseString ¶
type Subscription ¶
type Subscription struct {
Options Map `json:"options"`
EventName String `json:"eventName"`
}
Subscription represents an event subscription object that contains target event name and optional event options.
type Type ¶
type Type interface {
fmt.Stringer
// Name returns the name of the type represented by this Type.
Name() string
// Is checks if the provided value is of the type represented by this Type.
Is(Value) bool
}
func HostTypeOf ¶
HostTypeOf creates a new Type from a given value using reflection, for types not known to the runtime. It handles pointers, slices, and maps by unwrapping them and including their element types in the name. For example, a value of type *[]int would yield a Type with the name "[]int". This function is used as a fallback in TypeOf when a value doesn't match any known concrete types or interfaces. Note that the resulting Type may not have any special behavior beyond its name, and Is checks will likely fail unless the value is exactly the same type.
func NewType ¶
func NewType(pkg, name string, assert TypeMatcher) Type
NewType creates a new Type with the given package name, type name, and assertion function. The pkg parameter is the package name of the type, and the name parameter is the name of the type. The assert parameter is a TypeMatcher function that determines if a value matches this type. The resulting Type's Name will be in the format "pkg.name". If pkg is empty, it will panic. If name is empty, it will panic. Example usage:
myType := runtime.NewType("myPackage", "MyType", func(value runtime.Value) bool {
// Implement type matching logic here
return true // or false based on the logic
})
func NewTypeFor ¶
NewTypeFor creates a new Type with the given package name and type name, using a TypeMatcher that checks if a value is of type T. The pkg parameter is the package name of the type, and the name parameter is the name of the type. The resulting Type's Name will be in the format "pkg.name". If pkg is empty, it will panic. If name is empty, it will panic. Example usage:
type MyType struct{}
myType := runtime.NewTypeFor[MyType]("myPackage", "MyType")
This will create a Type that matches any value of type MyType.
func TypeOf ¶
TypeOf returns the Type of a given Value, respecting any Typed overrides. It checks for Typed first, then known concrete types and interfaces, and if no match is found, it falls back to HostTypeOf to create a Type based on the Go type of the value using reflection. This allows the runtime to recognize and work with types defined in the host environment, even if they don't implement any specific interfaces or aren't known concrete types within the runtime. For example, if a value is of a Go struct type that doesn't implement Typed or any known interfaces, HostTypeOf will create a Type with the name of that struct type, allowing it to be used in type checks and error messages within the runtime.
type TypeMatcher ¶
TypeMatcher is a function type that takes a Value and returns a boolean indicating whether the value matches a specific type.
type Typed ¶
type Typed interface {
Type() Type
}
Typed is an interface that can be implemented by any value to provide its type information.
type Unwrappable ¶
type Unwrappable interface {
Unwrap() any
}
Unwrappable represents an interface that can be unwrapped to get the underlying value.
type Value ¶
type Value interface {
fmt.Stringer
Hashable
// Copy returns a shallow copy of the value.
// TODO: Add context and error
Copy() Value
}
Value represents an interface of any type that needs to be used during runtime
func AddLeftFloat ¶
func AddLeftInt ¶
func CloneOrCopy ¶
CloneOrCopy creates a deep copy of the given value. If the value does not support cloning, it returns a shallow copy of the value.
func Parse ¶
Parse attempts to convert an arbitrary input into a Value type. Deprecated: Use ValueOf for explicit host-to-Ferret value conversion with error handling.
func ToNumberOrString ¶
ToNumberOrString attempts to convert an arbitrary Value into either a Number (Int or Float) or a String. If the input is already an Int, Float, or String, it returns it directly. For other types, it converts the input to its string representation and returns it as a String. This allows for flexible conversion of various Value types into a format that can be easily used as either a number or a string.
type ValueAssertion ¶
type ValueRemovable ¶
type ValueRemovable interface {
// Remove method removes the first occurrence of the given value or returns an error if the operation fails.
Remove(ctx context.Context, value Value) error
}
ValueRemovable is an interface for removing elements by their value in a collection-like structure.
Source Files
¶
- array.go
- array_iter.go
- assertions.go
- binary.go
- boolean.go
- box.go
- casting.go
- casting_types.go
- cloneable.go
- collections.go
- comparable.go
- date_time.go
- dispatchable.go
- errors.go
- float.go
- function.go
- function_builder.go
- function_collection.go
- function_helper.go
- function_lib.go
- function_registry.go
- hashable.go
- int.go
- iterator.go
- logger.go
- math.go
- measurable.go
- none.go
- noop_iter.go
- object.go
- object_iter.go
- object_like.go
- observable.go
- observable_iter.go
- params.go
- queryable.go
- range.go
- range_iter.go
- resource.go
- sort.go
- sort_direction.go
- sortable.go
- storage.go
- string.go
- string_utils.go
- type.go
- type_helpers.go
- types.go
- unwrappable.go
- value.go
- value_helpers.go