Documentation ¶
Overview ¶
Package element provides various types of column values, columns, records, and record channels
Index ¶
- Variables
- func ByteSize(src any) int
- type BigInt
- func (b *BigInt) AsBigInt() *big.Int
- func (b *BigInt) AsDecimal() decimal.Decimal
- func (b *BigInt) BigInt() BigIntNumber
- func (b *BigInt) Bool() (bool, error)
- func (b *BigInt) CloneBigInt() BigIntNumber
- func (b *BigInt) CloneDecimal() DecimalNumber
- func (b *BigInt) Decimal() DecimalNumber
- func (b *BigInt) Float64() (v float64, err error)
- func (b *BigInt) Int64() (int64, error)
- func (b *BigInt) String() string
- type BigIntColumnValue
- func (b *BigIntColumnValue) AsBigInt() (BigIntNumber, error)
- func (b *BigIntColumnValue) AsBool() (bool, error)
- func (b *BigIntColumnValue) AsBytes() ([]byte, error)
- func (b *BigIntColumnValue) AsDecimal() (DecimalNumber, error)
- func (b *BigIntColumnValue) AsString() (string, error)
- func (b *BigIntColumnValue) AsTime() (time.Time, error)
- func (b *BigIntColumnValue) Clone() ColumnValue
- func (b *BigIntColumnValue) Cmp(right ColumnValue) (int, error)
- func (n *BigIntColumnValue) IsNil() bool
- func (b *BigIntColumnValue) String() string
- func (b *BigIntColumnValue) Type() ColumnType
- type BigIntNumber
- type BigIntStr
- func (b *BigIntStr) AsBigInt() *big.Int
- func (b *BigIntStr) AsDecimal() decimal.Decimal
- func (b *BigIntStr) BigInt() BigIntNumber
- func (b *BigIntStr) Bool() (bool, error)
- func (b *BigIntStr) CloneBigInt() BigIntNumber
- func (b *BigIntStr) CloneDecimal() DecimalNumber
- func (b *BigIntStr) Decimal() DecimalNumber
- func (b *BigIntStr) Float64() (v float64, err error)
- func (b *BigIntStr) Int64() (int64, error)
- func (b *BigIntStr) String() string
- type BoolColumnValue
- func (b *BoolColumnValue) AsBigInt() (BigIntNumber, error)
- func (b *BoolColumnValue) AsBool() (bool, error)
- func (b *BoolColumnValue) AsBytes() ([]byte, error)
- func (b *BoolColumnValue) AsDecimal() (DecimalNumber, error)
- func (b *BoolColumnValue) AsString() (string, error)
- func (b *BoolColumnValue) AsTime() (time.Time, error)
- func (b *BoolColumnValue) Clone() ColumnValue
- func (b *BoolColumnValue) Cmp(right ColumnValue) (int, error)
- func (n *BoolColumnValue) IsNil() bool
- func (b *BoolColumnValue) String() string
- func (b *BoolColumnValue) Type() ColumnType
- type BytesColumnValue
- func (b *BytesColumnValue) AsBigInt() (BigIntNumber, error)
- func (b *BytesColumnValue) AsBool() (bool, error)
- func (b *BytesColumnValue) AsBytes() ([]byte, error)
- func (b *BytesColumnValue) AsDecimal() (DecimalNumber, error)
- func (b *BytesColumnValue) AsString() (string, error)
- func (b *BytesColumnValue) AsTime() (t time.Time, err error)
- func (b *BytesColumnValue) Clone() ColumnValue
- func (b *BytesColumnValue) Cmp(right ColumnValue) (int, error)
- func (n *BytesColumnValue) IsNil() bool
- func (b *BytesColumnValue) String() string
- func (b *BytesColumnValue) Type() ColumnType
- type Column
- type ColumnType
- type ColumnValue
- func NewBigIntColumnValue(v *big.Int) ColumnValue
- func NewBigIntColumnValueFromInt64(v int64) ColumnValue
- func NewBigIntColumnValueFromString(v string) (ColumnValue, error)
- func NewBigIntColumnValueFromUint64(v uint64) ColumnValue
- func NewBoolColumnValue(v bool) ColumnValue
- func NewBytesColumnValue(v []byte) ColumnValue
- func NewBytesColumnValueNoCopy(v []byte) ColumnValue
- func NewBytesColumnValueWithEncoder(v []byte, e TimeEncoder) ColumnValue
- func NewBytesColumnValueWithEncoderNoCopy(v []byte, e TimeEncoder) ColumnValue
- func NewDecimalColumnValue(d decimal.Decimal) ColumnValue
- func NewDecimalColumnValueFromFloat(f float64) ColumnValue
- func NewDecimalColumnValueFromFloat32(f float32) ColumnValue
- func NewDecimalColumnValueFromString(s string) (ColumnValue, error)
- func NewNilBigIntColumnValue() ColumnValue
- func NewNilBoolColumnValue() ColumnValue
- func NewNilBytesColumnValue() ColumnValue
- func NewNilDecimalColumnValue() ColumnValue
- func NewNilStringColumnValue() ColumnValue
- func NewNilTimeColumnValue() ColumnValue
- func NewStringColumnValue(s string) ColumnValue
- func NewStringColumnValueWithEncoder(s string, e TimeEncoder) ColumnValue
- func NewTimeColumnValue(t time.Time) ColumnValue
- func NewTimeColumnValueWithDecoder(t time.Time, d TimeDecoder) ColumnValue
- type ColumnValueClonable
- type ColumnValueComparabale
- type Converter
- func (c *Converter) ConvertBigInt(s string) (num BigIntNumber, err error)
- func (c *Converter) ConvertBigIntFromInt(i int64) (num BigIntNumber)
- func (c *Converter) ConvertBigIntFromUint(i uint64) (num BigIntNumber)
- func (c *Converter) ConvertDecimal(s string) (num DecimalNumber, err error)
- func (c *Converter) ConvertDecimalFromFloat(f float64) (num DecimalNumber)
- func (c *Converter) ConvertDecimalFromFloat32(f float32) (num DecimalNumber)
- type Decimal
- type DecimalColumnValue
- func (d *DecimalColumnValue) AsBigInt() (BigIntNumber, error)
- func (d *DecimalColumnValue) AsBool() (bool, error)
- func (d *DecimalColumnValue) AsBytes() ([]byte, error)
- func (d *DecimalColumnValue) AsDecimal() (DecimalNumber, error)
- func (d *DecimalColumnValue) AsString() (string, error)
- func (d *DecimalColumnValue) AsTime() (time.Time, error)
- func (d *DecimalColumnValue) Clone() ColumnValue
- func (d *DecimalColumnValue) Cmp(right ColumnValue) (int, error)
- func (n *DecimalColumnValue) IsNil() bool
- func (d *DecimalColumnValue) String() string
- func (d *DecimalColumnValue) Type() ColumnType
- type DecimalNumber
- type DecimalStr
- func (d *DecimalStr) AsDecimal() decimal.Decimal
- func (d *DecimalStr) BigInt() BigIntNumber
- func (d *DecimalStr) Bool() (bool, error)
- func (d *DecimalStr) CloneDecimal() DecimalNumber
- func (d *DecimalStr) Decimal() DecimalNumber
- func (d *DecimalStr) Float64() (v float64, err error)
- func (d *DecimalStr) String() string
- type DefaultColumn
- func (d *DefaultColumn) AsFloat64() (float64, error)
- func (d *DefaultColumn) AsInt64() (int64, error)
- func (d *DefaultColumn) ByteSize() int64
- func (d *DefaultColumn) Clone() (Column, error)
- func (d *DefaultColumn) Cmp(c Column) (int, error)
- func (d *DefaultColumn) MemorySize() int64
- func (d *DefaultColumn) Name() string
- type DefaultRecord
- func (r *DefaultRecord) Add(c Column) error
- func (r *DefaultRecord) ByteSize() int64
- func (r *DefaultRecord) ColumnNumber() int
- func (r *DefaultRecord) GetByIndex(i int) (Column, error)
- func (r *DefaultRecord) GetByName(name string) (Column, error)
- func (r *DefaultRecord) MemorySize() int64
- func (r *DefaultRecord) Put(c Column) error
- func (r *DefaultRecord) Set(i int, c Column) error
- func (r *DefaultRecord) String() string
- type Int64
- func (i *Int64) AsBigInt() *big.Int
- func (i *Int64) AsDecimal() decimal.Decimal
- func (i *Int64) BigInt() BigIntNumber
- func (i *Int64) Bool() (bool, error)
- func (i *Int64) CloneBigInt() BigIntNumber
- func (i *Int64) CloneDecimal() DecimalNumber
- func (i *Int64) Decimal() DecimalNumber
- func (i *Int64) Float64() (float64, error)
- func (i *Int64) Int64() (int64, error)
- func (i *Int64) String() string
- type NilBigIntColumnValue
- func (n NilBigIntColumnValue) AsBigInt() (BigIntNumber, error)
- func (n NilBigIntColumnValue) AsBool() (bool, error)
- func (n NilBigIntColumnValue) AsBytes() ([]byte, error)
- func (n NilBigIntColumnValue) AsDecimal() (DecimalNumber, error)
- func (n NilBigIntColumnValue) AsString() (string, error)
- func (n NilBigIntColumnValue) AsTime() (time.Time, error)
- func (n *NilBigIntColumnValue) Clone() ColumnValue
- func (n NilBigIntColumnValue) IsNil() bool
- func (n NilBigIntColumnValue) String() string
- func (n *NilBigIntColumnValue) Type() ColumnType
- type NilBoolColumnValue
- func (n NilBoolColumnValue) AsBigInt() (BigIntNumber, error)
- func (n NilBoolColumnValue) AsBool() (bool, error)
- func (n NilBoolColumnValue) AsBytes() ([]byte, error)
- func (n NilBoolColumnValue) AsDecimal() (DecimalNumber, error)
- func (n NilBoolColumnValue) AsString() (string, error)
- func (n NilBoolColumnValue) AsTime() (time.Time, error)
- func (n *NilBoolColumnValue) Clone() ColumnValue
- func (n NilBoolColumnValue) IsNil() bool
- func (n NilBoolColumnValue) String() string
- func (n *NilBoolColumnValue) Type() ColumnType
- type NilBytesColumnValue
- func (n NilBytesColumnValue) AsBigInt() (BigIntNumber, error)
- func (n NilBytesColumnValue) AsBool() (bool, error)
- func (n NilBytesColumnValue) AsBytes() ([]byte, error)
- func (n NilBytesColumnValue) AsDecimal() (DecimalNumber, error)
- func (n NilBytesColumnValue) AsString() (string, error)
- func (n NilBytesColumnValue) AsTime() (time.Time, error)
- func (n *NilBytesColumnValue) Clone() ColumnValue
- func (n NilBytesColumnValue) IsNil() bool
- func (n NilBytesColumnValue) String() string
- func (n *NilBytesColumnValue) Type() ColumnType
- type NilDecimalColumnValue
- func (n NilDecimalColumnValue) AsBigInt() (BigIntNumber, error)
- func (n NilDecimalColumnValue) AsBool() (bool, error)
- func (n NilDecimalColumnValue) AsBytes() ([]byte, error)
- func (n NilDecimalColumnValue) AsDecimal() (DecimalNumber, error)
- func (n NilDecimalColumnValue) AsString() (string, error)
- func (n NilDecimalColumnValue) AsTime() (time.Time, error)
- func (n *NilDecimalColumnValue) Clone() ColumnValue
- func (n NilDecimalColumnValue) IsNil() bool
- func (n NilDecimalColumnValue) String() string
- func (n *NilDecimalColumnValue) Type() ColumnType
- type NilStringColumnValue
- func (n NilStringColumnValue) AsBigInt() (BigIntNumber, error)
- func (n NilStringColumnValue) AsBool() (bool, error)
- func (n NilStringColumnValue) AsBytes() ([]byte, error)
- func (n NilStringColumnValue) AsDecimal() (DecimalNumber, error)
- func (n NilStringColumnValue) AsString() (string, error)
- func (n NilStringColumnValue) AsTime() (time.Time, error)
- func (n *NilStringColumnValue) Clone() ColumnValue
- func (n NilStringColumnValue) IsNil() bool
- func (n NilStringColumnValue) String() string
- func (n *NilStringColumnValue) Type() ColumnType
- type NilTimeColumnValue
- func (n NilTimeColumnValue) AsBigInt() (BigIntNumber, error)
- func (n NilTimeColumnValue) AsBool() (bool, error)
- func (n NilTimeColumnValue) AsBytes() ([]byte, error)
- func (n NilTimeColumnValue) AsDecimal() (DecimalNumber, error)
- func (n NilTimeColumnValue) AsString() (string, error)
- func (n NilTimeColumnValue) AsTime() (time.Time, error)
- func (n *NilTimeColumnValue) Clone() ColumnValue
- func (n NilTimeColumnValue) IsNil() bool
- func (n NilTimeColumnValue) String() string
- func (n *NilTimeColumnValue) Type() ColumnType
- type Number
- type NumberConverter
- type OldConverter
- func (c *OldConverter) ConvertBigInt(s string) (num BigIntNumber, err error)
- func (c *OldConverter) ConvertBigIntFromInt(i int64) (num BigIntNumber)
- func (c *OldConverter) ConvertBigIntFromUint(i uint64) (num BigIntNumber)
- func (c *OldConverter) ConvertDecimal(s string) (num DecimalNumber, err error)
- func (c *OldConverter) ConvertDecimalFromFloat(f float64) (num DecimalNumber)
- func (c *OldConverter) ConvertDecimalFromFloat32(f float32) (num DecimalNumber)
- type Record
- type RecordChan
- func (c *RecordChan) Buffered() int
- func (c *RecordChan) Close()
- func (c *RecordChan) PopFront() (r Record, ok bool)
- func (c *RecordChan) PopFrontAll(onRecord func(Record) error) error
- func (c *RecordChan) PushBack(r Record) int
- func (c *RecordChan) PushBackAll(fetchRecord func() (Record, error)) error
- type SetError
- type StringColumnValue
- func (s *StringColumnValue) AsBigInt() (BigIntNumber, error)
- func (s *StringColumnValue) AsBool() (v bool, err error)
- func (s *StringColumnValue) AsBytes() ([]byte, error)
- func (s *StringColumnValue) AsDecimal() (DecimalNumber, error)
- func (s *StringColumnValue) AsString() (string, error)
- func (s *StringColumnValue) AsTime() (t time.Time, err error)
- func (s *StringColumnValue) Clone() ColumnValue
- func (s *StringColumnValue) Cmp(right ColumnValue) (int, error)
- func (n *StringColumnValue) IsNil() bool
- func (s *StringColumnValue) String() string
- func (s *StringColumnValue) Type() ColumnType
- type StringTimeDecoder
- type StringTimeEncoder
- type TerminateRecord
- func (t *TerminateRecord) Add(Column) error
- func (t *TerminateRecord) ByteSize() int64
- func (t *TerminateRecord) ColumnNumber() int
- func (t *TerminateRecord) GetByIndex(i int) (Column, error)
- func (t *TerminateRecord) GetByName(name string) (Column, error)
- func (t *TerminateRecord) MemorySize() int64
- func (t *TerminateRecord) Put(c Column) error
- func (t *TerminateRecord) Set(i int, c Column) error
- func (t *TerminateRecord) String() string
- type TimeColumnValue
- func (t *TimeColumnValue) AsBigInt() (BigIntNumber, error)
- func (t *TimeColumnValue) AsBool() (bool, error)
- func (t *TimeColumnValue) AsBytes() (b []byte, err error)
- func (t *TimeColumnValue) AsDecimal() (DecimalNumber, error)
- func (t *TimeColumnValue) AsString() (s string, err error)
- func (t *TimeColumnValue) AsTime() (time.Time, error)
- func (t *TimeColumnValue) Clone() ColumnValue
- func (t *TimeColumnValue) Cmp(right ColumnValue) (int, error)
- func (n *TimeColumnValue) IsNil() bool
- func (t *TimeColumnValue) String() string
- func (t *TimeColumnValue) Type() ColumnType
- type TimeDecoder
- type TimeEncoder
- type TransformError
- type Uint64
- func (i *Uint64) AsBigInt() (bi *big.Int)
- func (i *Uint64) AsDecimal() decimal.Decimal
- func (i *Uint64) BigInt() BigIntNumber
- func (i *Uint64) Bool() (bool, error)
- func (i *Uint64) CloneBigInt() BigIntNumber
- func (i *Uint64) CloneDecimal() DecimalNumber
- func (i *Uint64) Decimal() DecimalNumber
- func (i *Uint64) Float64() (float64, error)
- func (i *Uint64) Int64() (int64, error)
- func (i *Uint64) String() string
Constants ¶
This section is empty.
Variables ¶
var ( ErrColumnExist = errors.New("column exist") // Column exists error ErrColumnNotExist = errors.New("column does not exist") // Column does not exist error ErrNilValue = errors.New("column value is nil") // Null value error ErrIndexOutOfRange = errors.New("column index is out of range") // Index value out of range ErrValueNotInt64 = errors.New("value is not int64") // Not an int64 error ErrValueInfinity = errors.New("value is infinity") // Infinite real number error ErrNotColumnValueClonable = errors.New("columnValue is not clonable") // Not a clonable column value ErrNotColumnValueComparable = errors.New("columnValue is not comparable") // Not a comparable column value ErrColumnNameNotEqual = errors.New("column name is not equal") // Column names differ )
Error
var DefaultTimeFormat = "2006-01-02 15:04:05.999999999Z07:00"
DefaultTimeFormat - Default time format
Functions ¶
Types ¶
type BigInt ¶
type BigInt struct {
// contains filtered or unexported fields
}
BigInt Big integer
func (*BigInt) BigInt ¶
func (b *BigInt) BigInt() BigIntNumber
BigInt Convert to high-precision integer
func (*BigInt) CloneBigInt ¶
func (b *BigInt) CloneBigInt() BigIntNumber
CloneBigInt Clone high-precision integer
func (*BigInt) CloneDecimal ¶
func (b *BigInt) CloneDecimal() DecimalNumber
CloneDecimal Clone high-precision decimal
func (*BigInt) Decimal ¶
func (b *BigInt) Decimal() DecimalNumber
Decimal Convert to high-precision decimal
type BigIntColumnValue ¶
type BigIntColumnValue struct {
// contains filtered or unexported fields
}
BigIntColumnValue - Value for a big integer column
func (*BigIntColumnValue) AsBigInt ¶
func (b *BigIntColumnValue) AsBigInt() (BigIntNumber, error)
AsBigInt - Convert to a big integer
func (*BigIntColumnValue) AsBool ¶
func (b *BigIntColumnValue) AsBool() (bool, error)
AsBool - Convert to a boolean value, where non-zero becomes true and zero becomes false
func (*BigIntColumnValue) AsBytes ¶
func (b *BigIntColumnValue) AsBytes() ([]byte, error)
AsBytes - Convert to a byte stream, e.g., 1234556790 becomes [49, 50, 51, 52, 53, 54, 55, 56, 57, 48]
func (*BigIntColumnValue) AsDecimal ¶
func (b *BigIntColumnValue) AsDecimal() (DecimalNumber, error)
AsDecimal - Convert to a high-precision decimal number
func (*BigIntColumnValue) AsString ¶
func (b *BigIntColumnValue) AsString() (string, error)
AsString - Convert to a string, e.g., 1234556790 becomes 1234556790
func (*BigIntColumnValue) AsTime ¶
func (b *BigIntColumnValue) AsTime() (time.Time, error)
AsTime - Currently, integers cannot be converted to time
func (*BigIntColumnValue) Clone ¶
func (b *BigIntColumnValue) Clone() ColumnValue
Clone - Clone the big integer column value
func (*BigIntColumnValue) Cmp ¶
func (b *BigIntColumnValue) Cmp(right ColumnValue) (int, error)
Cmp - Return 1 for greater than, 0 for equal, and -1 for less than
func (*BigIntColumnValue) String ¶
func (b *BigIntColumnValue) String() string
func (*BigIntColumnValue) Type ¶
func (b *BigIntColumnValue) Type() ColumnType
Type - Return the type of the column
type BigIntNumber ¶
type BigIntNumber interface { Number Int64() (int64, error) Decimal() DecimalNumber CloneBigInt() BigIntNumber AsBigInt() *big.Int }
BigIntNumber High-precision integer
type BigIntStr ¶
type BigIntStr struct {
// contains filtered or unexported fields
}
BigIntStr High-precision integer string
func (*BigIntStr) BigInt ¶
func (b *BigIntStr) BigInt() BigIntNumber
BigInt Convert to high-precision integer
func (*BigIntStr) CloneBigInt ¶
func (b *BigIntStr) CloneBigInt() BigIntNumber
CloneBigInt Clone high-precision integer
func (*BigIntStr) CloneDecimal ¶
func (b *BigIntStr) CloneDecimal() DecimalNumber
CloneDecimal Clone high-precision decimal
func (*BigIntStr) Decimal ¶
func (b *BigIntStr) Decimal() DecimalNumber
Decimal Convert to high-precision decimal
type BoolColumnValue ¶
type BoolColumnValue struct {
// contains filtered or unexported fields
}
BoolColumnValue represents a Boolean column value
func (*BoolColumnValue) AsBigInt ¶
func (b *BoolColumnValue) AsBigInt() (BigIntNumber, error)
AsBigInt converts it to a big integer, where true becomes 1 and false becomes 0
func (*BoolColumnValue) AsBool ¶
func (b *BoolColumnValue) AsBool() (bool, error)
AsBool converts it to a boolean value
func (*BoolColumnValue) AsBytes ¶
func (b *BoolColumnValue) AsBytes() ([]byte, error)
AsBytes converts it to a byte stream, where true becomes true and false becomes false
func (*BoolColumnValue) AsDecimal ¶
func (b *BoolColumnValue) AsDecimal() (DecimalNumber, error)
AsDecimal converts it to a high-precision decimal number, where true becomes 1.0 and false becomes 0.0
func (*BoolColumnValue) AsString ¶
func (b *BoolColumnValue) AsString() (string, error)
AsString converts it to a string, where true becomes true and false becomes false
func (*BoolColumnValue) AsTime ¶
func (b *BoolColumnValue) AsTime() (time.Time, error)
AsTime Currently, a Boolean cannot be converted to a time value
func (*BoolColumnValue) Clone ¶
func (b *BoolColumnValue) Clone() ColumnValue
Clone clones a Boolean column value
func (*BoolColumnValue) Cmp ¶
func (b *BoolColumnValue) Cmp(right ColumnValue) (int, error)
Cmp Returns 1 for greater than, 0 for equal, and -1 for less than
func (*BoolColumnValue) String ¶
func (b *BoolColumnValue) String() string
func (*BoolColumnValue) Type ¶
func (b *BoolColumnValue) Type() ColumnType
Type returns the type of the column
type BytesColumnValue ¶
type BytesColumnValue struct { TimeEncoder // Time Encoder // contains filtered or unexported fields }
BytesColumnValue - Byte stream column value
func (*BytesColumnValue) AsBigInt ¶
func (b *BytesColumnValue) AsBigInt() (BigIntNumber, error)
AsBigInt - Convert to an integer. Real numbers and scientific notation strings will be rounded. Non-numeric values will report an error. E.g., 123.67 is converted to 123, and 123.12 is converted to 123.
func (*BytesColumnValue) AsBool ¶
func (b *BytesColumnValue) AsBool() (bool, error)
AsBool - Convert 1, t, T, TRUE, true, True to true Convert 0, f, F, FALSE, false, False to false. If none of the above, an error is reported.
func (*BytesColumnValue) AsBytes ¶
func (b *BytesColumnValue) AsBytes() ([]byte, error)
AsBytes - Convert to a byte stream
func (*BytesColumnValue) AsDecimal ¶
func (b *BytesColumnValue) AsDecimal() (DecimalNumber, error)
AsDecimal - Convert to a high-precision decimal. Real numbers and scientific notation strings can be converted. Non-numeric values will report an error.
func (*BytesColumnValue) AsString ¶
func (b *BytesColumnValue) AsString() (string, error)
AsString - Convert to a string
func (*BytesColumnValue) AsTime ¶
func (b *BytesColumnValue) AsTime() (t time.Time, err error)
AsTime - Convert to time based on the time encoder. If it does not match the time encoder format, an error is reported.
func (*BytesColumnValue) Clone ¶
func (b *BytesColumnValue) Clone() ColumnValue
Clone - Clone the byte stream column value
func (*BytesColumnValue) Cmp ¶
func (b *BytesColumnValue) Cmp(right ColumnValue) (int, error)
Cmp - Return 1 for greater than, 0 for equal, and -1 for less than
func (*BytesColumnValue) String ¶
func (b *BytesColumnValue) String() string
func (*BytesColumnValue) Type ¶
func (b *BytesColumnValue) Type() ColumnType
Type - Return the column type
type Column ¶
type Column interface { ColumnValue AsInt64() (int64, error) // ToInt64: Convert to 64-bit integer AsFloat64() (float64, error) // ToFloat64: Convert to 64-bit real number Clone() (Column, error) // Clone: Clone Cmp(Column) (int, error) // Compare: 1 represents greater than, 0 represents equal, -1 represents less than Name() string // Name: Column name ByteSize() int64 // ByteSize: Byte stream size MemorySize() int64 // MemorySize: Memory size }
Column Column
func NewDefaultColumn ¶
func NewDefaultColumn(v ColumnValue, name string, byteSize int) Column
NewDefaultColumn Create a new default column based on column value v, column name name, and byte stream size byteSize
type ColumnType ¶
type ColumnType string
ColumnType Column Type
const ( TypeUnknown ColumnType = "unknown" // UnknownType: Unknown type TypeBool ColumnType = "bool" // BoolType: Boolean type TypeBigInt ColumnType = "bigInt" // IntType: Integer type TypeDecimal ColumnType = "decimal" // DecimalType: High-precision real number type TypeString ColumnType = "string" // StringType: String type TypeBytes ColumnType = "bytes" // BytesType: Byte stream type TypeTime ColumnType = "time" // TimeType: Time type )
ColumnTypeEnum Enumeration of column types
type ColumnValue ¶
type ColumnValue interface { fmt.Stringer Type() ColumnType // ColumnType: Column type IsNil() bool // IsNull: Whether it is null AsBool() (bool, error) // ToBool: Convert to boolean AsBigInt() (BigIntNumber, error) // ToInt: Convert to integer AsDecimal() (DecimalNumber, error) // ToDecimal: Convert to high-precision real number AsString() (string, error) // ToString: Convert to string AsBytes() ([]byte, error) // ToBytes: Convert to byte stream AsTime() (time.Time, error) // ToTime: Convert to time }
ColumnValue Column Value
func NewBigIntColumnValue ¶
func NewBigIntColumnValue(v *big.Int) ColumnValue
NewBigIntColumnValue - Create a big integer column value from a big.Int v
func NewBigIntColumnValueFromInt64 ¶
func NewBigIntColumnValueFromInt64(v int64) ColumnValue
NewBigIntColumnValueFromInt64 - Create a big integer column value from an int64 v
func NewBigIntColumnValueFromString ¶
func NewBigIntColumnValueFromString(v string) (ColumnValue, error)
NewBigIntColumnValueFromString - Create a big integer column value from a string v If the string v is not an integer, an error is returned
func NewBigIntColumnValueFromUint64 ¶ added in v0.2.0
func NewBigIntColumnValueFromUint64(v uint64) ColumnValue
NewBigIntColumnValueFromUint64 - Create a big integer column value from an int64 v
func NewBoolColumnValue ¶
func NewBoolColumnValue(v bool) ColumnValue
NewBoolColumnValue creates a Boolean column value from the boolean value v
func NewBytesColumnValue ¶
func NewBytesColumnValue(v []byte) ColumnValue
NewBytesColumnValue - Generate a byte stream column value from byte stream v, making a copy
func NewBytesColumnValueNoCopy ¶
func NewBytesColumnValueNoCopy(v []byte) ColumnValue
NewBytesColumnValueNoCopy - Generate a byte stream column value from byte stream v, without making a copy
func NewBytesColumnValueWithEncoder ¶
func NewBytesColumnValueWithEncoder(v []byte, e TimeEncoder) ColumnValue
NewBytesColumnValueWithEncoder - Generate a byte stream column value from byte stream v and time encoder e, making a copy
func NewBytesColumnValueWithEncoderNoCopy ¶
func NewBytesColumnValueWithEncoderNoCopy(v []byte, e TimeEncoder) ColumnValue
NewBytesColumnValueWithEncoderNoCopy - Generate a byte stream column value from byte stream v and time encoder e, without making a copy
func NewDecimalColumnValue ¶
func NewDecimalColumnValue(d decimal.Decimal) ColumnValue
NewDecimalColumnValue creates a high-precision decimal column value from a high-precision decimal value.
func NewDecimalColumnValueFromFloat ¶
func NewDecimalColumnValueFromFloat(f float64) ColumnValue
NewDecimalColumnValueFromFloat creates a high-precision decimal column value from a float64 value.
func NewDecimalColumnValueFromFloat32 ¶ added in v0.2.0
func NewDecimalColumnValueFromFloat32(f float32) ColumnValue
NewDecimalColumnValueFromFloat32 creates a high-precision decimal column value from a float64 value.
func NewDecimalColumnValueFromString ¶
func NewDecimalColumnValueFromString(s string) (ColumnValue, error)
NewDecimalColumnValueFromString creates a high-precision decimal column value from a string. If the string is not a numeric value or in scientific notation, an error will be reported.
func NewNilBigIntColumnValue ¶
func NewNilBigIntColumnValue() ColumnValue
NewNilBigIntColumnValue - Create a null value for a big integer column
func NewNilBoolColumnValue ¶
func NewNilBoolColumnValue() ColumnValue
NewNilBoolColumnValue creates an empty Boolean column value
func NewNilBytesColumnValue ¶
func NewNilBytesColumnValue() ColumnValue
NewNilBytesColumnValue - Create a null byte stream column value
func NewNilDecimalColumnValue ¶
func NewNilDecimalColumnValue() ColumnValue
NewNilDecimalColumnValue creates a null value for a high-precision decimal column.
func NewNilStringColumnValue ¶
func NewNilStringColumnValue() ColumnValue
NewNilStringColumnValue - Create a null value for a string column
func NewNilTimeColumnValue ¶
func NewNilTimeColumnValue() ColumnValue
NewNilTimeColumnValue creates an empty time column value
func NewStringColumnValue ¶
func NewStringColumnValue(s string) ColumnValue
NewStringColumnValue - Create a string column value based on the string s
func NewStringColumnValueWithEncoder ¶
func NewStringColumnValueWithEncoder(s string, e TimeEncoder) ColumnValue
NewStringColumnValueWithEncoder - Create a string column value based on the string s and time encoder e
func NewTimeColumnValue ¶
func NewTimeColumnValue(t time.Time) ColumnValue
NewTimeColumnValue creates a time column value from the time t
func NewTimeColumnValueWithDecoder ¶
func NewTimeColumnValueWithDecoder(t time.Time, d TimeDecoder) ColumnValue
NewTimeColumnValueWithDecoder creates a time column value from the time t and the time decoder
type ColumnValueClonable ¶
type ColumnValueClonable interface {
Clone() ColumnValue // Clone: Clone
}
ColumnValueClonable Cloneable column value
type ColumnValueComparabale ¶
type ColumnValueComparabale interface { // Compare: 1 represents greater than, 0 represents equal, -1 represents less than Cmp(ColumnValue) (int, error) }
ColumnValueComparabale Comparable column value
type Converter ¶
type Converter struct{}
Converter Number converter
func (*Converter) ConvertBigInt ¶
func (c *Converter) ConvertBigInt(s string) (num BigIntNumber, err error)
ConvertBigInt converts a string to an integer
func (*Converter) ConvertBigIntFromInt ¶
func (c *Converter) ConvertBigIntFromInt(i int64) (num BigIntNumber)
ConvertBigIntFromInt Convert to decimal from integer
func (*Converter) ConvertBigIntFromUint ¶ added in v0.2.0
func (c *Converter) ConvertBigIntFromUint(i uint64) (num BigIntNumber)
ConvertBigIntFromUint Convert to decimal from unsigned integer
func (*Converter) ConvertDecimal ¶
func (c *Converter) ConvertDecimal(s string) (num DecimalNumber, err error)
ConvertDecimal Convert string to decimal
func (*Converter) ConvertDecimalFromFloat ¶
func (c *Converter) ConvertDecimalFromFloat(f float64) (num DecimalNumber)
ConvertDecimalFromFloat Convert to decimal from floating-point number
func (*Converter) ConvertDecimalFromFloat32 ¶ added in v0.2.0
func (c *Converter) ConvertDecimalFromFloat32(f float32) (num DecimalNumber)
ConvertDecimalFromFloat32 Convert to decimal from 32-bit loating-point number
type Decimal ¶
type Decimal struct {
// contains filtered or unexported fields
}
Decimal High-precision decimal
func (*Decimal) BigInt ¶
func (d *Decimal) BigInt() BigIntNumber
BigInt Convert to high-precision integer
func (*Decimal) CloneDecimal ¶
func (d *Decimal) CloneDecimal() DecimalNumber
CloneDecimal Clone high-precision decimal
func (*Decimal) Decimal ¶
func (d *Decimal) Decimal() DecimalNumber
Decimal Convert to high-precision decimal
type DecimalColumnValue ¶
type DecimalColumnValue struct {
// contains filtered or unexported fields
}
DecimalColumnValue represents a high-precision decimal column value.
func (*DecimalColumnValue) AsBigInt ¶
func (d *DecimalColumnValue) AsBigInt() (BigIntNumber, error)
AsBigInt rounds down the high-precision decimal value, e.g., 123.67 becomes 123, and 123.12 becomes 123.
func (*DecimalColumnValue) AsBool ¶
func (d *DecimalColumnValue) AsBool() (bool, error)
AsBool converts non-zero values to true and zero values to false.
func (*DecimalColumnValue) AsBytes ¶
func (d *DecimalColumnValue) AsBytes() ([]byte, error)
AsBytes converts to a byte stream, e.g., 10.123 becomes the byte representation of 10.123.
func (*DecimalColumnValue) AsDecimal ¶
func (d *DecimalColumnValue) AsDecimal() (DecimalNumber, error)
AsDecimal converts to a high-precision decimal.
func (*DecimalColumnValue) AsString ¶
func (d *DecimalColumnValue) AsString() (string, error)
AsString converts to a string, e.g., 10.123 becomes 10.123.
func (*DecimalColumnValue) AsTime ¶
func (d *DecimalColumnValue) AsTime() (time.Time, error)
AsTime currently cannot convert to a time value.
func (*DecimalColumnValue) Clone ¶
func (d *DecimalColumnValue) Clone() ColumnValue
Clone creates a copy (clone) of a high-precision decimal column value.
func (*DecimalColumnValue) Cmp ¶
func (d *DecimalColumnValue) Cmp(right ColumnValue) (int, error)
Cmp returns 1 for greater than, 0 for equal, and -1 for less than.
func (*DecimalColumnValue) IsNil ¶
func (n *DecimalColumnValue) IsNil() bool
IsNil Whether it is null
func (*DecimalColumnValue) String ¶
func (d *DecimalColumnValue) String() string
func (*DecimalColumnValue) Type ¶
func (d *DecimalColumnValue) Type() ColumnType
Type represents the type of the column.
type DecimalNumber ¶
type DecimalNumber interface { Number Float64() (float64, error) BigInt() BigIntNumber CloneDecimal() DecimalNumber AsDecimal() decimal.Decimal }
DecimalNumber High-precision decimal
type DecimalStr ¶
type DecimalStr struct {
// contains filtered or unexported fields
}
DecimalStr High-precision decimal string
func (*DecimalStr) AsDecimal ¶
func (d *DecimalStr) AsDecimal() decimal.Decimal
AsDecimal Convert to high-precision decimal
func (*DecimalStr) BigInt ¶
func (d *DecimalStr) BigInt() BigIntNumber
BigInt Convert to high-precision integer
func (*DecimalStr) CloneDecimal ¶
func (d *DecimalStr) CloneDecimal() DecimalNumber
CloneDecimal Clone high-precision decimal
func (*DecimalStr) Decimal ¶
func (d *DecimalStr) Decimal() DecimalNumber
Decimal Convert to high-precision decimal
func (*DecimalStr) Float64 ¶
func (d *DecimalStr) Float64() (v float64, err error)
Float64 Convert to 64-bit floating-point number
type DefaultColumn ¶
type DefaultColumn struct { ColumnValue // ColumnValue Column value // contains filtered or unexported fields }
DefaultColumn Default value
func (*DefaultColumn) AsFloat64 ¶
func (d *DefaultColumn) AsFloat64() (float64, error)
AsFloat64 Convert to 64-bit real number
func (*DefaultColumn) AsInt64 ¶
func (d *DefaultColumn) AsInt64() (int64, error)
AsInt64 Convert to 64-bit integer
func (*DefaultColumn) Clone ¶
func (d *DefaultColumn) Clone() (Column, error)
Clone Clone a column. If it's not a cloneable column value, an error will occur.
func (*DefaultColumn) Cmp ¶
func (d *DefaultColumn) Cmp(c Column) (int, error)
Cmp Compare columns. If it's not a comparable column value, an error will occur.
func (*DefaultColumn) MemorySize ¶
func (d *DefaultColumn) MemorySize() int64
MemorySize Memory size
type DefaultRecord ¶
type DefaultRecord struct {
// contains filtered or unexported fields
}
DefaultRecord represents a default record.
func NewDefaultRecord ¶
func NewDefaultRecord() *DefaultRecord
NewDefaultRecord creates a new default record.
func (*DefaultRecord) Add ¶
func (r *DefaultRecord) Add(c Column) error
Add adds a new column c. If column c already exists, an error is reported.
func (*DefaultRecord) ByteSize ¶
func (r *DefaultRecord) ByteSize() int64
ByteSize represents the size of the record in bytes.
func (*DefaultRecord) ColumnNumber ¶
func (r *DefaultRecord) ColumnNumber() int
ColumnNumber represents the number of columns in the record.
func (*DefaultRecord) GetByIndex ¶
func (r *DefaultRecord) GetByIndex(i int) (Column, error)
GetByIndex gets the column at index i. If the index is out of range or doesn't exist, an error is reported.
func (*DefaultRecord) GetByName ¶
func (r *DefaultRecord) GetByName(name string) (Column, error)
GetByName gets the column with the specified name. If the column doesn't exist, an error is reported.
func (*DefaultRecord) MemorySize ¶
func (r *DefaultRecord) MemorySize() int64
MemorySize represents the size of the record in memory.
func (*DefaultRecord) Put ¶
func (r *DefaultRecord) Put(c Column) error
Put sets the value of the column with the specified name. If the column name doesn't exist, an error is reported.
func (*DefaultRecord) Set ¶
func (r *DefaultRecord) Set(i int, c Column) error
Set sets the value of the column at index i. If the index is out of range, an error is reported.
func (*DefaultRecord) String ¶
func (r *DefaultRecord) String() string
String is an empty method placeholder.
type Int64 ¶
type Int64 struct {
// contains filtered or unexported fields
}
Int64 64-bit integer
func (*Int64) BigInt ¶
func (i *Int64) BigInt() BigIntNumber
BigInt Convert to high-precision integer
func (*Int64) CloneBigInt ¶
func (i *Int64) CloneBigInt() BigIntNumber
CloneBigInt Clone high-precision integer
func (*Int64) CloneDecimal ¶
func (i *Int64) CloneDecimal() DecimalNumber
CloneDecimal Clone high-precision decimal
func (*Int64) Decimal ¶
func (i *Int64) Decimal() DecimalNumber
Decimal Convert to high-precision decimal
type NilBigIntColumnValue ¶
type NilBigIntColumnValue struct {
// contains filtered or unexported fields
}
NilBigIntColumnValue - Null value for a big integer column
func (NilBigIntColumnValue) AsBigInt ¶
func (n NilBigIntColumnValue) AsBigInt() (BigIntNumber, error)
AsBigInt Failed to convert to integer
func (NilBigIntColumnValue) AsDecimal ¶
func (n NilBigIntColumnValue) AsDecimal() (DecimalNumber, error)
AsDecimal Failed to convert to high-precision real number
func (*NilBigIntColumnValue) Clone ¶
func (n *NilBigIntColumnValue) Clone() ColumnValue
Clone - Clone the null value for a big integer column
func (NilBigIntColumnValue) IsNil ¶
func (n NilBigIntColumnValue) IsNil() bool
IsNil Whether it is null
func (NilBigIntColumnValue) String ¶
func (n NilBigIntColumnValue) String() string
String Printing display
func (*NilBigIntColumnValue) Type ¶
func (n *NilBigIntColumnValue) Type() ColumnType
Type - Return the type of the column
type NilBoolColumnValue ¶
type NilBoolColumnValue struct {
// contains filtered or unexported fields
}
NilBoolColumnValue represents an empty Boolean column value
func (NilBoolColumnValue) AsBigInt ¶
func (n NilBoolColumnValue) AsBigInt() (BigIntNumber, error)
AsBigInt Failed to convert to integer
func (NilBoolColumnValue) AsDecimal ¶
func (n NilBoolColumnValue) AsDecimal() (DecimalNumber, error)
AsDecimal Failed to convert to high-precision real number
func (*NilBoolColumnValue) Clone ¶
func (n *NilBoolColumnValue) Clone() ColumnValue
Clone clones an empty Boolean column value
func (NilBoolColumnValue) String ¶
func (n NilBoolColumnValue) String() string
String Printing display
func (*NilBoolColumnValue) Type ¶
func (n *NilBoolColumnValue) Type() ColumnType
Type returns the type of the column
type NilBytesColumnValue ¶
type NilBytesColumnValue struct {
// contains filtered or unexported fields
}
NilBytesColumnValue - Null byte stream column value
func (NilBytesColumnValue) AsBigInt ¶
func (n NilBytesColumnValue) AsBigInt() (BigIntNumber, error)
AsBigInt Failed to convert to integer
func (NilBytesColumnValue) AsDecimal ¶
func (n NilBytesColumnValue) AsDecimal() (DecimalNumber, error)
AsDecimal Failed to convert to high-precision real number
func (*NilBytesColumnValue) Clone ¶
func (n *NilBytesColumnValue) Clone() ColumnValue
Clone - Clone the null byte stream column value
func (NilBytesColumnValue) IsNil ¶
func (n NilBytesColumnValue) IsNil() bool
IsNil Whether it is null
func (NilBytesColumnValue) String ¶
func (n NilBytesColumnValue) String() string
String Printing display
func (*NilBytesColumnValue) Type ¶
func (n *NilBytesColumnValue) Type() ColumnType
Type - Return the column type
type NilDecimalColumnValue ¶
type NilDecimalColumnValue struct {
// contains filtered or unexported fields
}
NilDecimalColumnValue represents a null value for a high-precision decimal column.
func (NilDecimalColumnValue) AsBigInt ¶
func (n NilDecimalColumnValue) AsBigInt() (BigIntNumber, error)
AsBigInt Failed to convert to integer
func (NilDecimalColumnValue) AsDecimal ¶
func (n NilDecimalColumnValue) AsDecimal() (DecimalNumber, error)
AsDecimal Failed to convert to high-precision real number
func (*NilDecimalColumnValue) Clone ¶
func (n *NilDecimalColumnValue) Clone() ColumnValue
Clone creates a copy (clone) of a high-precision decimal column value.
func (NilDecimalColumnValue) IsNil ¶
func (n NilDecimalColumnValue) IsNil() bool
IsNil Whether it is null
func (NilDecimalColumnValue) String ¶
func (n NilDecimalColumnValue) String() string
String Printing display
func (*NilDecimalColumnValue) Type ¶
func (n *NilDecimalColumnValue) Type() ColumnType
Type represents the type of the column.
type NilStringColumnValue ¶
type NilStringColumnValue struct {
// contains filtered or unexported fields
}
NilStringColumnValue - Null value for a string column
func (NilStringColumnValue) AsBigInt ¶
func (n NilStringColumnValue) AsBigInt() (BigIntNumber, error)
AsBigInt Failed to convert to integer
func (NilStringColumnValue) AsDecimal ¶
func (n NilStringColumnValue) AsDecimal() (DecimalNumber, error)
AsDecimal Failed to convert to high-precision real number
func (*NilStringColumnValue) Clone ¶
func (n *NilStringColumnValue) Clone() ColumnValue
Clone - Clone the null string value
func (NilStringColumnValue) IsNil ¶
func (n NilStringColumnValue) IsNil() bool
IsNil Whether it is null
func (NilStringColumnValue) String ¶
func (n NilStringColumnValue) String() string
String Printing display
func (*NilStringColumnValue) Type ¶
func (n *NilStringColumnValue) Type() ColumnType
Type - Column type
type NilTimeColumnValue ¶
type NilTimeColumnValue struct {
// contains filtered or unexported fields
}
NilTimeColumnValue represents an empty time column value
func (NilTimeColumnValue) AsBigInt ¶
func (n NilTimeColumnValue) AsBigInt() (BigIntNumber, error)
AsBigInt Failed to convert to integer
func (NilTimeColumnValue) AsDecimal ¶
func (n NilTimeColumnValue) AsDecimal() (DecimalNumber, error)
AsDecimal Failed to convert to high-precision real number
func (*NilTimeColumnValue) Clone ¶
func (n *NilTimeColumnValue) Clone() ColumnValue
Clone clones an empty time column value
func (NilTimeColumnValue) String ¶
func (n NilTimeColumnValue) String() string
String Printing display
func (*NilTimeColumnValue) Type ¶
func (n *NilTimeColumnValue) Type() ColumnType
Type returns the type of the column
type NumberConverter ¶
type NumberConverter interface { ConvertBigIntFromInt(i int64) (num BigIntNumber) ConvertBigIntFromUint(i uint64) (num BigIntNumber) ConvertDecimalFromFloat32(f float32) (num DecimalNumber) ConvertDecimalFromFloat(f float64) (num DecimalNumber) ConvertBigInt(s string) (num BigIntNumber, err error) ConvertDecimal(s string) (num DecimalNumber, err error) }
NumberConverter Number converter
type OldConverter ¶
type OldConverter struct{}
OldConverter Unchecked conversion
func (*OldConverter) ConvertBigInt ¶
func (c *OldConverter) ConvertBigInt(s string) (num BigIntNumber, err error)
ConvertBigInt Convert string to integer
func (*OldConverter) ConvertBigIntFromInt ¶
func (c *OldConverter) ConvertBigIntFromInt(i int64) (num BigIntNumber)
ConvertBigIntFromInt Convert to decimal from integer
func (*OldConverter) ConvertBigIntFromUint ¶ added in v0.2.0
func (c *OldConverter) ConvertBigIntFromUint(i uint64) (num BigIntNumber)
ConvertBigIntFromUint Convert to decimal from unsigned integer
func (*OldConverter) ConvertDecimal ¶
func (c *OldConverter) ConvertDecimal(s string) (num DecimalNumber, err error)
ConvertDecimal Convert string to decimal
func (*OldConverter) ConvertDecimalFromFloat ¶
func (c *OldConverter) ConvertDecimalFromFloat(f float64) (num DecimalNumber)
ConvertDecimalFromFloat Convert to decimal from floating-point number
func (*OldConverter) ConvertDecimalFromFloat32 ¶ added in v0.2.0
func (c *OldConverter) ConvertDecimalFromFloat32(f float32) (num DecimalNumber)
ConvertDecimalFromFloat32 Convert to decimal from 32-bit loating-point number
type Record ¶
type Record interface { fmt.Stringer Add(Column) error // AddColumn adds a new column to the record. GetByIndex(i int) (Column, error) // GetColumnByIndex gets the column at index i. GetByName(name string) (Column, error) // GetColumnByName gets the column with the specified name. Set(i int, c Column) error // SetColumnByIndex sets the value of the column at index i. Put(c Column) error // SetColumn sets the value of the specified column. ColumnNumber() int // GetColumnCount returns the number of columns in the record. ByteSize() int64 // ByteSize returns the size of the record in bytes. MemorySize() int64 // MemorySize returns the size of the record in memory. }
Record represents a record in a dataset.
func GetTerminateRecord ¶
func GetTerminateRecord() Record
GetTerminateRecord gets the termination record.
type RecordChan ¶
type RecordChan struct {
// contains filtered or unexported fields
}
RecordChan Record channel. Fixes memory overflow issues.
func NewRecordChan ¶
func NewRecordChan(ctx context.Context) *RecordChan
NewRecordChan Create a new record channel.
func NewRecordChanBuffer ¶
func NewRecordChanBuffer(ctx context.Context, n int) *RecordChan
NewRecordChanBuffer Create a new record channel with a capacity of n.
func (*RecordChan) Buffered ¶
func (c *RecordChan) Buffered() int
Buffered Number of elements currently buffered in the record channel.
func (*RecordChan) PopFront ¶
func (c *RecordChan) PopFront() (r Record, ok bool)
PopFront Remove and return the record at the front of the channel, and indicate whether there are more values remaining.
func (*RecordChan) PopFrontAll ¶
func (c *RecordChan) PopFrontAll(onRecord func(Record) error) error
PopFrontAll Remove and return all records from the front of the channel using the onRecord function.
func (*RecordChan) PushBack ¶
func (c *RecordChan) PushBack(r Record) int
PushBack Append a record r to the end of the channel and return the current size of the queue.
func (*RecordChan) PushBackAll ¶
func (c *RecordChan) PushBackAll(fetchRecord func() (Record, error)) error
PushBackAll Append multiple records obtained through the fetchRecord function to the end of the channel.
type SetError ¶
type SetError struct {
// contains filtered or unexported fields
}
SetError Sets an error
func NewSetError ¶
func NewSetError(i any, other ColumnType, err error) *SetError
NewSetError Generates a setting error by setting the value i to the specified other type with the error err
type StringColumnValue ¶
type StringColumnValue struct { TimeEncoder // contains filtered or unexported fields }
StringColumnValue - Value for a string column. Note: Decimal 123.0 (val:1230, exp:-1) is not equivalent to 123 (val:123, exp:0)
func (*StringColumnValue) AsBigInt ¶
func (s *StringColumnValue) AsBigInt() (BigIntNumber, error)
AsBigInt - Convert to a big integer. Floating-point numbers and scientific notation strings will be rounded. Non-numeric values will throw an error. E.g., 123.67 is converted to 123, and 123.12 is converted to 123.
func (*StringColumnValue) AsBool ¶
func (s *StringColumnValue) AsBool() (v bool, err error)
AsBool - Convert 1, t, T, TRUE, true, True to true Convert 0, f, F, FALSE, false, False to false. If none of the above, an error is thrown.
func (*StringColumnValue) AsBytes ¶
func (s *StringColumnValue) AsBytes() ([]byte, error)
AsBytes - Convert to a byte stream
func (*StringColumnValue) AsDecimal ¶
func (s *StringColumnValue) AsDecimal() (DecimalNumber, error)
AsDecimal - Convert to a decimal. Floating-point numbers and scientific notation strings can be converted. Non-numeric values will throw an error.
func (*StringColumnValue) AsString ¶
func (s *StringColumnValue) AsString() (string, error)
AsString - Convert to a string
func (*StringColumnValue) AsTime ¶
func (s *StringColumnValue) AsTime() (t time.Time, err error)
AsTime - Convert to a time based on the time encoder. If the format does not match the time encoder, an error is thrown.
func (*StringColumnValue) Clone ¶
func (s *StringColumnValue) Clone() ColumnValue
Clone - Clone the string column value
func (*StringColumnValue) Cmp ¶
func (s *StringColumnValue) Cmp(right ColumnValue) (int, error)
Cmp - Return 1 for greater than, 0 for equal, -1 for less than
func (*StringColumnValue) String ¶
func (s *StringColumnValue) String() string
type StringTimeDecoder ¶
type StringTimeDecoder struct {
// contains filtered or unexported fields
}
StringTimeDecoder - String time decoder
func (*StringTimeDecoder) Layout ¶ added in v0.1.1
func (d *StringTimeDecoder) Layout() string
Layout - Time format
func (*StringTimeDecoder) TimeDecode ¶
func (d *StringTimeDecoder) TimeDecode(t time.Time) (any, error)
TimeDecode - Decode a string time based on the layout of the go time format into a string
type StringTimeEncoder ¶
type StringTimeEncoder struct {
// contains filtered or unexported fields
}
StringTimeEncoder - String time encoder
func (*StringTimeEncoder) TimeEncode ¶
func (e *StringTimeEncoder) TimeEncode(i any) (time.Time, error)
TimeEncode - Encode to time. If 'i' is not a string or not in the layout format, an error will be reported.
type TerminateRecord ¶
type TerminateRecord struct{}
TerminateRecord represents a termination record.
func (*TerminateRecord) Add ¶
func (t *TerminateRecord) Add(Column) error
Add is an empty method placeholder.
func (*TerminateRecord) ByteSize ¶
func (t *TerminateRecord) ByteSize() int64
ByteSize is an empty method placeholder.
func (*TerminateRecord) ColumnNumber ¶
func (t *TerminateRecord) ColumnNumber() int
ColumnNumber is an empty method placeholder.
func (*TerminateRecord) GetByIndex ¶
func (t *TerminateRecord) GetByIndex(i int) (Column, error)
GetByIndex is an empty method placeholder.
func (*TerminateRecord) GetByName ¶
func (t *TerminateRecord) GetByName(name string) (Column, error)
GetByName is an empty method placeholder.
func (*TerminateRecord) MemorySize ¶
func (t *TerminateRecord) MemorySize() int64
MemorySize is an empty method placeholder.
func (*TerminateRecord) Put ¶
func (t *TerminateRecord) Put(c Column) error
Put is an empty method placeholder.
func (*TerminateRecord) Set ¶
func (t *TerminateRecord) Set(i int, c Column) error
Set is an empty method placeholder.
func (*TerminateRecord) String ¶
func (t *TerminateRecord) String() string
String is an empty method placeholder.
type TimeColumnValue ¶
type TimeColumnValue struct { TimeDecoder // Time decoder // contains filtered or unexported fields }
TimeColumnValue represents a time column value
func (*TimeColumnValue) AsBigInt ¶
func (t *TimeColumnValue) AsBigInt() (BigIntNumber, error)
AsBigInt Cannot convert to a big integer
func (*TimeColumnValue) AsBool ¶
func (t *TimeColumnValue) AsBool() (bool, error)
AsBool Cannot convert to a boolean value
func (*TimeColumnValue) AsBytes ¶
func (t *TimeColumnValue) AsBytes() (b []byte, err error)
AsBytes Converts to a byte stream
func (*TimeColumnValue) AsDecimal ¶
func (t *TimeColumnValue) AsDecimal() (DecimalNumber, error)
AsDecimal Cannot convert to a high-precision decimal number
func (*TimeColumnValue) AsString ¶
func (t *TimeColumnValue) AsString() (s string, err error)
AsString Converts to a string
func (*TimeColumnValue) AsTime ¶
func (t *TimeColumnValue) AsTime() (time.Time, error)
AsTime Converts to a time value
func (*TimeColumnValue) Clone ¶
func (t *TimeColumnValue) Clone() ColumnValue
Clone clones a time column value
func (*TimeColumnValue) Cmp ¶
func (t *TimeColumnValue) Cmp(right ColumnValue) (int, error)
Cmp Returns 1 for greater than, 0 for equal, and -1 for less than
func (*TimeColumnValue) String ¶
func (t *TimeColumnValue) String() string
func (*TimeColumnValue) Type ¶
func (t *TimeColumnValue) Type() ColumnType
Type returns the type of the column
type TimeDecoder ¶
TimeDecoder - Time decoder
func NewStringTimeDecoder ¶
func NewStringTimeDecoder(layout string) TimeDecoder
NewStringTimeDecoder - A string time decoder based on the layout of the go time format
type TimeEncoder ¶
TimeEncoder - Time encoder
func NewStringTimeEncoder ¶
func NewStringTimeEncoder(layout string) TimeEncoder
NewStringTimeEncoder - A string time encoder based on the layout of the go time format
type TransformError ¶
type TransformError struct {
// contains filtered or unexported fields
}
TransformError Conversion error
func NewTransformError ¶
func NewTransformError(msg string, err error) *TransformError
NewTransformError Creates a conversion error based on the message msg and error err
func NewTransformErrorFormColumnTypes ¶
func NewTransformErrorFormColumnTypes(one, other ColumnType, err error) *TransformError
NewTransformErrorFormColumnTypes Generates a conversion error from the error err when converting from type one to type other
func NewTransformErrorFormString ¶
func NewTransformErrorFormString(one, other string, err error) *TransformError
NewTransformErrorFormString Generates a conversion error from the error err when converting from one to other
func (*TransformError) Error ¶
func (e *TransformError) Error() string
func (*TransformError) Unwrap ¶
func (e *TransformError) Unwrap() error
type Uint64 ¶ added in v0.2.0
type Uint64 struct {
// contains filtered or unexported fields
}
Uint64 ungined 64-bit integer
func (*Uint64) BigInt ¶ added in v0.2.0
func (i *Uint64) BigInt() BigIntNumber
BigInt Convert to high-precision integer
func (*Uint64) CloneBigInt ¶ added in v0.2.0
func (i *Uint64) CloneBigInt() BigIntNumber
CloneBigInt Clone high-precision integer
func (*Uint64) CloneDecimal ¶ added in v0.2.0
func (i *Uint64) CloneDecimal() DecimalNumber
CloneDecimal Clone high-precision decimal
func (*Uint64) Decimal ¶ added in v0.2.0
func (i *Uint64) Decimal() DecimalNumber
Decimal Convert to high-precision decimal
func (*Uint64) Float64 ¶ added in v0.2.0
Float64 Convert to 64-bit floating-point number. But it will result in loss of precision.