Documentation ¶
Index ¶
- Variables
- func RegisterType(t Type)
- type Adder
- type Any
- type Bool
- type Bytes
- type Comparer
- type Divider
- type Duration
- type Equaler
- type Float
- func (f Float) Add(v Value) (Value, error)
- func (f Float) Compare(v Value) (Value, error)
- func (f Float) Div(v Value) (Value, error)
- func (f Float) Equal(v Value) (LogicalValue, error)
- func (f Float) GoValue() any
- func (f Float) Mul(v Value) (Value, error)
- func (f Float) Neg() (Value, error)
- func (f Float) Sub(v Value) (Value, error)
- func (f Float) Type() Type
- type Int
- func (i Int) Add(v Value) (Value, error)
- func (i Int) Compare(v Value) (Value, error)
- func (i Int) Div(v Value) (Value, error)
- func (i Int) Equal(v Value) (LogicalValue, error)
- func (i Int) GoValue() any
- func (i Int) Mod(v Value) (Value, error)
- func (i Int) Mul(v Value) (Value, error)
- func (i Int) Neg() (Value, error)
- func (i Int) Sub(v Value) (Value, error)
- func (i Int) Type() Type
- type LogicalValue
- type Modder
- type Multiplier
- type Negator
- type Nil
- type Sizer
- type String
- type Subtractor
- type Time
- type Type
- type Uint
- func (i Uint) Add(v Value) (Value, error)
- func (i Uint) Compare(v Value) (Value, error)
- func (i Uint) Div(v Value) (Value, error)
- func (i Uint) Equal(v Value) (LogicalValue, error)
- func (i Uint) GoValue() any
- func (i Uint) Mod(v Value) (Value, error)
- func (i Uint) Mul(v Value) (Value, error)
- func (i Uint) Sub(v Value) (Value, error)
- func (i Uint) Type() Type
- type Value
Constants ¶
This section is empty.
Variables ¶
var ( // ErrUnsupportedType is the error that the value type is not supported. ErrUnsupportedType = errors.New("unsupported type") // ErrOperationNotDefined is the error that the operation is not defined. ErrOperationNotDefined = errors.New("operation not defined") )
Functions ¶
func RegisterType ¶
func RegisterType(t Type)
RegisterType registers an abstract type t. Later registered types take precedence over earlier ones.
Types ¶
type Any ¶
type Any struct {
// contains filtered or unexported fields
}
Any represents an undefined type value.
func (Any) Equal ¶
func (a Any) Equal(v Value) (LogicalValue, error)
Equal implements Equaler interface.
type Bool ¶
type Bool bool
Bool represents a bool value.
type Bytes ¶
type Bytes []byte
Bytes represents a bytes value.
func (Bytes) Equal ¶
func (b Bytes) Equal(v Value) (LogicalValue, error)
Equal implements Equaler interface.
type Duration ¶
Duration represents a duration value.
func (Duration) Equal ¶
func (d Duration) Equal(v Value) (LogicalValue, error)
Equal implements Equaler interface.
type Equaler ¶
type Equaler interface {
Equal(Value) (LogicalValue, error)
}
Equaler is an interface that supports '==' operator.
type Float ¶
type Float float64
Float represents a float value.
type Int ¶
type Int int64
Int represents an int value.
type LogicalValue ¶
LogicalValue is an interface that can be used in a boolean context.
type Multiplier ¶
Multiplier is an interface that supports '*' operator.
type Nil ¶
type Nil struct {
// contains filtered or unexported fields
}
Nil represents a nil value.
type String ¶
type String string
String represents a string value.
func (String) Equal ¶
func (s String) Equal(v Value) (LogicalValue, error)
Equal implements Equaler interface.
type Subtractor ¶
Subtractor is an interface that supports '-' operator.
type Time ¶
Time represents a time value.