Documentation
¶
Index ¶
- type BaseColumn
- type BoolColumn
- type BytesColumn
- type Column
- type ColumnFactory
- type ColumnType
- type DateColumn
- type DefaultColumnFactory
- func (f *DefaultColumnFactory) CreateBoolColumn(value bool) Column
- func (f *DefaultColumnFactory) CreateBytesColumn(value []byte) Column
- func (f *DefaultColumnFactory) CreateDateColumn(value time.Time) Column
- func (f *DefaultColumnFactory) CreateDoubleColumn(value float64) Column
- func (f *DefaultColumnFactory) CreateLongColumn(value int64) Column
- func (f *DefaultColumnFactory) CreateNullColumn(columnType ColumnType) Column
- func (f *DefaultColumnFactory) CreateStringColumn(value string) Column
- type DefaultRecord
- type DefaultRecordFactory
- type DoubleColumn
- func (c *DoubleColumn) GetAsBool() (bool, error)
- func (c *DoubleColumn) GetAsBytes() ([]byte, error)
- func (c *DoubleColumn) GetAsDate() (time.Time, error)
- func (c *DoubleColumn) GetAsDouble() (float64, error)
- func (c *DoubleColumn) GetAsLong() (int64, error)
- func (c *DoubleColumn) GetAsString() string
- type LongColumn
- type Record
- type RecordFactory
- type StringColumn
- func (c *StringColumn) GetAsBool() (bool, error)
- func (c *StringColumn) GetAsBytes() ([]byte, error)
- func (c *StringColumn) GetAsDate() (time.Time, error)
- func (c *StringColumn) GetAsDouble() (float64, error)
- func (c *StringColumn) GetAsLong() (int64, error)
- func (c *StringColumn) GetAsString() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseColumn ¶
type BaseColumn struct {
// contains filtered or unexported fields
}
BaseColumn 基础列实现
func (*BaseColumn) GetByteSize ¶
func (c *BaseColumn) GetByteSize() int
func (*BaseColumn) GetRawData ¶
func (c *BaseColumn) GetRawData() interface{}
func (*BaseColumn) GetType ¶
func (c *BaseColumn) GetType() ColumnType
func (*BaseColumn) IsNull ¶
func (c *BaseColumn) IsNull() bool
type BoolColumn ¶
type BoolColumn struct {
BaseColumn
}
BoolColumn 布尔列
func NewBoolColumn ¶
func NewBoolColumn(value bool) *BoolColumn
func NewNullBoolColumn ¶
func NewNullBoolColumn() *BoolColumn
func (*BoolColumn) GetAsBool ¶
func (c *BoolColumn) GetAsBool() (bool, error)
func (*BoolColumn) GetAsBytes ¶
func (c *BoolColumn) GetAsBytes() ([]byte, error)
func (*BoolColumn) GetAsDouble ¶
func (c *BoolColumn) GetAsDouble() (float64, error)
func (*BoolColumn) GetAsLong ¶
func (c *BoolColumn) GetAsLong() (int64, error)
func (*BoolColumn) GetAsString ¶
func (c *BoolColumn) GetAsString() string
type BytesColumn ¶
type BytesColumn struct {
BaseColumn
}
BytesColumn 字节列
func NewBytesColumn ¶
func NewBytesColumn(value []byte) *BytesColumn
func NewNullBytesColumn ¶
func NewNullBytesColumn() *BytesColumn
func (*BytesColumn) GetAsBool ¶
func (c *BytesColumn) GetAsBool() (bool, error)
func (*BytesColumn) GetAsBytes ¶
func (c *BytesColumn) GetAsBytes() ([]byte, error)
func (*BytesColumn) GetAsDouble ¶
func (c *BytesColumn) GetAsDouble() (float64, error)
func (*BytesColumn) GetAsLong ¶
func (c *BytesColumn) GetAsLong() (int64, error)
func (*BytesColumn) GetAsString ¶
func (c *BytesColumn) GetAsString() string
type Column ¶
type Column interface {
GetType() ColumnType
GetRawData() interface{}
GetAsString() string
GetAsLong() (int64, error)
GetAsDouble() (float64, error)
GetAsDate() (time.Time, error)
GetAsBool() (bool, error)
GetAsBytes() ([]byte, error)
IsNull() bool
GetByteSize() int
}
Column 接口定义列的基本操作 - 纯接口定义,无实现
type ColumnFactory ¶
type ColumnFactory interface {
CreateStringColumn(value string) Column
CreateLongColumn(value int64) Column
CreateDoubleColumn(value float64) Column
CreateDateColumn(value time.Time) Column
CreateBoolColumn(value bool) Column
CreateBytesColumn(value []byte) Column
CreateNullColumn(columnType ColumnType) Column
}
ColumnFactory 列工厂接口 - 创建各种类型列的抽象工厂
func NewColumnFactory ¶
func NewColumnFactory() ColumnFactory
type ColumnType ¶
type ColumnType int
ColumnType 定义列类型
const ( TypeNull ColumnType = iota TypeLong TypeDouble TypeString TypeDate TypeBool TypeBytes )
type DateColumn ¶
type DateColumn struct {
BaseColumn
}
DateColumn 日期列
func NewDateColumn ¶
func NewDateColumn(value time.Time) *DateColumn
func NewNullDateColumn ¶
func NewNullDateColumn() *DateColumn
func (*DateColumn) GetAsBool ¶
func (c *DateColumn) GetAsBool() (bool, error)
func (*DateColumn) GetAsBytes ¶
func (c *DateColumn) GetAsBytes() ([]byte, error)
func (*DateColumn) GetAsDouble ¶
func (c *DateColumn) GetAsDouble() (float64, error)
func (*DateColumn) GetAsLong ¶
func (c *DateColumn) GetAsLong() (int64, error)
func (*DateColumn) GetAsString ¶
func (c *DateColumn) GetAsString() string
type DefaultColumnFactory ¶
type DefaultColumnFactory struct{}
DefaultColumnFactory 默认列工厂实现
func (*DefaultColumnFactory) CreateBoolColumn ¶
func (f *DefaultColumnFactory) CreateBoolColumn(value bool) Column
func (*DefaultColumnFactory) CreateBytesColumn ¶
func (f *DefaultColumnFactory) CreateBytesColumn(value []byte) Column
func (*DefaultColumnFactory) CreateDateColumn ¶
func (f *DefaultColumnFactory) CreateDateColumn(value time.Time) Column
func (*DefaultColumnFactory) CreateDoubleColumn ¶
func (f *DefaultColumnFactory) CreateDoubleColumn(value float64) Column
func (*DefaultColumnFactory) CreateLongColumn ¶
func (f *DefaultColumnFactory) CreateLongColumn(value int64) Column
func (*DefaultColumnFactory) CreateNullColumn ¶
func (f *DefaultColumnFactory) CreateNullColumn(columnType ColumnType) Column
func (*DefaultColumnFactory) CreateStringColumn ¶
func (f *DefaultColumnFactory) CreateStringColumn(value string) Column
type DefaultRecord ¶
type DefaultRecord struct {
// contains filtered or unexported fields
}
DefaultRecord provides the standard implementation of the Record interface with dynamic column storage and efficient memory management.
func NewRecord ¶
func NewRecord() *DefaultRecord
func (*DefaultRecord) AddColumn ¶
func (r *DefaultRecord) AddColumn(column Column)
func (*DefaultRecord) GetByteSize ¶
func (r *DefaultRecord) GetByteSize() int
func (*DefaultRecord) GetColumn ¶
func (r *DefaultRecord) GetColumn(index int) Column
func (*DefaultRecord) GetColumnNumber ¶
func (r *DefaultRecord) GetColumnNumber() int
func (*DefaultRecord) SetColumn ¶
func (r *DefaultRecord) SetColumn(index int, column Column)
func (*DefaultRecord) String ¶
func (r *DefaultRecord) String() string
type DefaultRecordFactory ¶
type DefaultRecordFactory struct{}
DefaultRecordFactory provides the standard implementation for record creation.
func (*DefaultRecordFactory) CreateRecord ¶
func (f *DefaultRecordFactory) CreateRecord() Record
type DoubleColumn ¶
type DoubleColumn struct {
BaseColumn
}
DoubleColumn 浮点数列
func NewDoubleColumn ¶
func NewDoubleColumn(value float64) *DoubleColumn
func NewNullDoubleColumn ¶
func NewNullDoubleColumn() *DoubleColumn
func (*DoubleColumn) GetAsBool ¶
func (c *DoubleColumn) GetAsBool() (bool, error)
func (*DoubleColumn) GetAsBytes ¶
func (c *DoubleColumn) GetAsBytes() ([]byte, error)
func (*DoubleColumn) GetAsDouble ¶
func (c *DoubleColumn) GetAsDouble() (float64, error)
func (*DoubleColumn) GetAsLong ¶
func (c *DoubleColumn) GetAsLong() (int64, error)
func (*DoubleColumn) GetAsString ¶
func (c *DoubleColumn) GetAsString() string
type LongColumn ¶
type LongColumn struct {
BaseColumn
}
LongColumn 长整型列
func NewLongColumn ¶
func NewLongColumn(value int64) *LongColumn
func NewNullLongColumn ¶
func NewNullLongColumn() *LongColumn
func (*LongColumn) GetAsBool ¶
func (c *LongColumn) GetAsBool() (bool, error)
func (*LongColumn) GetAsBytes ¶
func (c *LongColumn) GetAsBytes() ([]byte, error)
func (*LongColumn) GetAsDouble ¶
func (c *LongColumn) GetAsDouble() (float64, error)
func (*LongColumn) GetAsLong ¶
func (c *LongColumn) GetAsLong() (int64, error)
func (*LongColumn) GetAsString ¶
func (c *LongColumn) GetAsString() string
type Record ¶
type Record interface {
AddColumn(column Column)
SetColumn(index int, column Column)
GetColumn(index int) Column
GetColumnNumber() int
GetByteSize() int
String() string
}
Record represents a single row of data with columnar structure. Provides operations for column manipulation and data access.
type RecordFactory ¶
type RecordFactory interface {
CreateRecord() Record
}
RecordFactory provides abstraction for creating Record instances.
func NewRecordFactory ¶
func NewRecordFactory() RecordFactory
type StringColumn ¶
type StringColumn struct {
BaseColumn
}
StringColumn 字符串列
func NewStringColumn ¶
func NewStringColumn(value string) *StringColumn
func (*StringColumn) GetAsBool ¶
func (c *StringColumn) GetAsBool() (bool, error)
func (*StringColumn) GetAsBytes ¶
func (c *StringColumn) GetAsBytes() ([]byte, error)
func (*StringColumn) GetAsDouble ¶
func (c *StringColumn) GetAsDouble() (float64, error)
func (*StringColumn) GetAsLong ¶
func (c *StringColumn) GetAsLong() (int64, error)
func (*StringColumn) GetAsString ¶
func (c *StringColumn) GetAsString() string