Documentation ¶
Index ¶
- Variables
- func BinStreamFullIterate(dec *Decoder, r io.Reader, opt ...*StreamReaderOptions) error
- func BinStreamWriteF(w io.Writer, enc *Encoder, next func() (rec Recorde, err error), ...) (err error)
- func CsvStreamFullIterate(r *csv.Reader, opt ...*CsvStreamReaderOptions) error
- func CsvStreamWriteF(opt CsvStreamWriterOptions, w *csv.Writer, ...) (err error)
- func Each(it RecordsIterator, cb func(i int, r Recorde) error) (err error)
- func IOWriter(f func(data []byte) (n int, err error)) io.Writer
- func IsDateTimeTool(typ ColumnType) (ok bool)
- func IsDateTool(typ ColumnType) (ok bool)
- func IsZonedTimeTool(typ ColumnType) (ok bool)
- func Iterate(it RecordsIterator) (err error)
- func JsonStreamWriteF(config *JsonStreamWriterConfig, next func() (rec Recorde, err error)) (err error)
- func NextRecords(recs []Recorde) (next func() (rec Recorde, err error))
- func OpenDB(name string) (db *sql.DB, err error)
- func OpenDBv(name string) (db *sql.DB, err error)
- func OpenIterate(opener RecordsIteratorOpener) (err error)
- type BinColumnReader
- type BinColumnWriter
- type BinRecordReader
- type BinRecordWriter
- type BinRecordsStreamIterator
- type BinStreamReader
- type BinStreamWriter
- func (this *BinStreamWriter) Close() error
- func (this *BinStreamWriter) Columns() []*Column
- func (this *BinStreamWriter) Encoder() *Encoder
- func (this *BinStreamWriter) Failed() bool
- func (this *BinStreamWriter) Flush() (err error)
- func (this *BinStreamWriter) RecordsCount() int64
- func (this *BinStreamWriter) Write(rec Recorde) (err error)
- type CTFloat32
- type CTFloat64
- type CTbid
- func (CTbid) BinRead(r io.Reader) (v interface{}, err error)
- func (CTbid) BinWrite(w io.Writer, v interface{}) (err error)
- func (this *CTbid) DateOf(value interface{}) civil.Date
- func (CTbid) Decode(value string) (v interface{}, err error)
- func (CTbid) Encode(value interface{}) string
- func (CTbid) Limited() bool
- func (CTbid) Zero() interface{}
- type CTbool
- func (CTbool) BinRead(r io.Reader) (v interface{}, err error)
- func (CTbool) BinWrite(w io.Writer, v interface{}) (err error)
- func (CTbool) Decode(value string) (v interface{}, err error)
- func (CTbool) Description() string
- func (CTbool) Encode(value interface{}) string
- func (CTbool) Zero() interface{}
- type CTbyte
- func (CTbyte) BinRead(r io.Reader) (v interface{}, err error)
- func (CTbyte) BinWrite(w io.Writer, v interface{}) (err error)
- func (CTbyte) Decode(value string) (v interface{}, err error)
- func (CTbyte) Description() string
- func (CTbyte) Encode(value interface{}) string
- func (CTbyte) TypeName() string
- func (CTbyte) Zero() interface{}
- type CTbytes
- func (CTbytes) BinRead(r io.Reader) (v interface{}, err error)
- func (CTbytes) BinWrite(w io.Writer, v interface{}) (err error)
- func (CTbytes) Decode(value string) (v interface{}, err error)
- func (CTbytes) Description() string
- func (CTbytes) Encode(value interface{}) string
- func (CTbytes) TypeName() string
- func (CTbytes) Zero() interface{}
- type CTdate
- type CTdtime
- type CTdtimeZ
- func (CTdtimeZ) BinRead(r io.Reader) (v interface{}, err error)
- func (CTdtimeZ) BinWrite(w io.Writer, v interface{}) (err error)
- func (CTdtimeZ) Decode(value string) (v interface{}, err error)
- func (CTdtimeZ) Description() string
- func (CTdtimeZ) Encode(value interface{}) string
- func (CTdtimeZ) Zone(value interface{}) (h, m int)
- type CTint16
- type CTint32
- type CTint64
- type CTint8
- type CTstring
- func (CTstring) BinRead(r io.Reader) (v interface{}, err error)
- func (CTstring) BinWrite(w io.Writer, v interface{}) (err error)
- func (CTstring) Decode(value string) (v interface{}, err error)
- func (CTstring) Description() string
- func (CTstring) Encode(value interface{}) string
- func (CTstring) Zero() interface{}
- type CTtime
- func (CTtime) BinRead(r io.Reader) (v interface{}, err error)
- func (CTtime) BinWrite(w io.Writer, v interface{}) (err error)
- func (CTtime) Decode(value string) (v interface{}, err error)
- func (CTtime) Description() string
- func (CTtime) Encode(value interface{}) string
- func (CTtime) Zero() interface{}
- type CTtimeZ
- func (CTtimeZ) BinRead(r io.Reader) (v interface{}, err error)
- func (CTtimeZ) BinWrite(w io.Writer, v interface{}) (err error)
- func (CTtimeZ) Decode(value string) (v interface{}, err error)
- func (CTtimeZ) Description() string
- func (CTtimeZ) Encode(value interface{}) string
- func (CTtimeZ) Zero() interface{}
- func (CTtimeZ) Zone(value interface{}) (h, m int)
- type CTuint16
- type CTuint32
- type CTuint64
- type CTuint8
- type Cache
- type Column
- func (this *Column) AllowBlank() bool
- func (this *Column) MaxLength() uint16
- func (this *Column) Required() bool
- func (this *Column) SetMaxLength(maxLength uint16)
- func (this *Column) String() string
- func (this *Column) Type() ColumnType
- func (this *Column) Unique() bool
- func (this *Column) Validate(ctx context.Context, value interface{}) (err error)
- func (this *Column) Validator(f ...ColumnValidator)
- func (this *Column) Validators() []ColumnValidator
- func (this *Column) ValueType() reflect.Type
- type ColumnReader
- type ColumnTool
- type ColumnType
- type ColumnValidator
- type ColumnWriter
- type CsvDataBridge
- type CsvRecordReader
- type CsvRecordWriter
- type CsvStreamReader
- type CsvStreamReaderIterator
- type CsvStreamReaderOptions
- type CsvStreamWriter
- func (this *CsvStreamWriter) Close() (err error)
- func (this *CsvStreamWriter) Columns() []*Column
- func (this *CsvStreamWriter) CsvWriter() *csv.Writer
- func (this *CsvStreamWriter) Encoder() *Encoder
- func (this *CsvStreamWriter) Failed() bool
- func (this *CsvStreamWriter) Last() Recorde
- func (this *CsvStreamWriter) RecordsCount() int64
- func (this *CsvStreamWriter) Write(rec Recorde) (err error)
- type CsvStreamWriterOptions
- type DateTime
- type DateTool
- type Decoder
- type Encoder
- type Flags
- type InputCmd
- type InputCmdStoper
- type JsonRecordWriter
- type JsonStreamWriter
- func (this *JsonStreamWriter) Close() (err error)
- func (this *JsonStreamWriter) Columns() []*Column
- func (this *JsonStreamWriter) Encoder() *Encoder
- func (this *JsonStreamWriter) Failed() bool
- func (this *JsonStreamWriter) RecordsCount() int64
- func (this *JsonStreamWriter) Write(rec Recorde) (err error)
- type JsonStreamWriterConfig
- type JsonWriterConfig
- type LimitColumnTool
- type MemCacheReader
- type ReadHeader
- type RecordReader
- type RecordWriter
- type Recorde
- type RecordsIterator
- type RecordsIteratorOpener
- type StreamReaderOptions
- type TimeZero
- type ToolDateTimer
- type ToolDater
- type ToolZonedTimer
- type UnLimitColumnTool
Constants ¶
This section is empty.
Variables ¶
View Source
var ColumnTypeTool = newColumnTypeTool()
Functions ¶
func BinStreamFullIterate ¶
func BinStreamFullIterate(dec *Decoder, r io.Reader, opt ...*StreamReaderOptions) error
func BinStreamWriteF ¶
func CsvStreamFullIterate ¶
func CsvStreamFullIterate(r *csv.Reader, opt ...*CsvStreamReaderOptions) error
func CsvStreamWriteF ¶
func IsDateTimeTool ¶
func IsDateTimeTool(typ ColumnType) (ok bool)
func IsDateTool ¶
func IsDateTool(typ ColumnType) (ok bool)
func IsZonedTimeTool ¶
func IsZonedTimeTool(typ ColumnType) (ok bool)
func Iterate ¶
func Iterate(it RecordsIterator) (err error)
func JsonStreamWriteF ¶
func JsonStreamWriteF(config *JsonStreamWriterConfig, next func() (rec Recorde, err error)) (err error)
func NextRecords ¶
func OpenIterate ¶
func OpenIterate(opener RecordsIteratorOpener) (err error)
Types ¶
type BinColumnReader ¶
type BinColumnReader struct {
// contains filtered or unexported fields
}
func (*BinColumnReader) Read ¶
func (this *BinColumnReader) Read() (col *Column, err error)
type BinColumnWriter ¶
type BinColumnWriter struct {
// contains filtered or unexported fields
}
func NewBinColumnWriter ¶
func NewBinColumnWriter(w io.Writer) *BinColumnWriter
func (*BinColumnWriter) Write ¶
func (this *BinColumnWriter) Write(col *Column) (err error)
type BinRecordReader ¶
type BinRecordReader struct {
// contains filtered or unexported fields
}
func NewBinRecordReader ¶
func NewBinRecordReader(ed *Decoder, r io.Reader) *BinRecordReader
func (*BinRecordReader) Read ¶
func (this *BinRecordReader) Read() (rec Recorde, err error)
type BinRecordWriter ¶
type BinRecordWriter struct {
// contains filtered or unexported fields
}
func NewBinRecordWriter ¶
func NewBinRecordWriter(ed *Encoder, w io.Writer) *BinRecordWriter
func (*BinRecordWriter) Write ¶
func (this *BinRecordWriter) Write(rec Recorde) (err error)
type BinRecordsStreamIterator ¶
type BinRecordsStreamIterator struct {
// contains filtered or unexported fields
}
func (BinRecordsStreamIterator) Done ¶
func (BinRecordsStreamIterator) Done(state interface{}) (ok bool)
func (*BinRecordsStreamIterator) Next ¶
func (this *BinRecordsStreamIterator) Next(state interface{}) (rec Recorde, newState interface{}, err error)
func (*BinRecordsStreamIterator) Start ¶
func (this *BinRecordsStreamIterator) Start() (state interface{}, err error)
type BinStreamReader ¶
type BinStreamReader struct {
// contains filtered or unexported fields
}
func NewBinStreamReader ¶
func NewBinStreamReader(dec *Decoder, r io.Reader, opts ...*StreamReaderOptions) *BinStreamReader
func (*BinStreamReader) Open ¶
func (this *BinStreamReader) Open() (header *ReadHeader, it RecordsIterator, err error)
type BinStreamWriter ¶
type BinStreamWriter struct { MaxBufferSize uint32 // contains filtered or unexported fields }
func NewBinStreamWriter ¶
func NewBinStreamWriter(encoder *Encoder, w io.Writer, maxBufSize ...uint32) *BinStreamWriter
func (*BinStreamWriter) Close ¶
func (this *BinStreamWriter) Close() error
func (*BinStreamWriter) Columns ¶
func (this *BinStreamWriter) Columns() []*Column
func (*BinStreamWriter) Encoder ¶
func (this *BinStreamWriter) Encoder() *Encoder
func (*BinStreamWriter) Failed ¶
func (this *BinStreamWriter) Failed() bool
func (*BinStreamWriter) Flush ¶
func (this *BinStreamWriter) Flush() (err error)
func (*BinStreamWriter) RecordsCount ¶
func (this *BinStreamWriter) RecordsCount() int64
func (*BinStreamWriter) Write ¶
func (this *BinStreamWriter) Write(rec Recorde) (err error)
type CTFloat32 ¶
type CTFloat32 struct {
UnLimitColumnTool
}
type CTFloat64 ¶
type CTFloat64 struct {
UnLimitColumnTool
}
type CTdate ¶
type CTdate struct { UnLimitColumnTool TimeZero DateTool }
type CTdtime ¶
func (CTdtime) Description ¶
type CTdtimeZ ¶
func (CTdtimeZ) Description ¶
type CTint16 ¶
type CTint16 struct{ UnLimitColumnTool }
type CTint32 ¶
type CTint32 struct{ UnLimitColumnTool }
type CTint64 ¶
type CTint64 struct{ UnLimitColumnTool }
type CTint8 ¶
type CTint8 struct{ UnLimitColumnTool }
type CTuint16 ¶
type CTuint16 struct{ UnLimitColumnTool }
type CTuint32 ¶
type CTuint32 struct{ UnLimitColumnTool }
type CTuint64 ¶
type CTuint64 struct{ UnLimitColumnTool }
type CTuint8 ¶
type CTuint8 struct{ UnLimitColumnTool }
type Cache ¶
type Column ¶
type Column struct { Name string Tool ColumnTool Data map[interface{}]interface{} // contains filtered or unexported fields }
func MustParseColumn ¶
func MustParseColumns ¶
func ParseColumn ¶
func ParseColumns ¶
func (*Column) AllowBlank ¶
func (*Column) SetMaxLength ¶
func (*Column) Type ¶
func (this *Column) Type() ColumnType
func (*Column) Validator ¶
func (this *Column) Validator(f ...ColumnValidator)
func (*Column) Validators ¶
func (this *Column) Validators() []ColumnValidator
type ColumnReader ¶
type ColumnTool ¶
type ColumnType ¶
type ColumnType string
const ( CtBool ColumnType = "b" CtString ColumnType = "s" CtByte ColumnType = "B" CtBytes ColumnType = "Bs" )
const ( CtDTime ColumnType = "T" CtDTimeZ ColumnType = "Tz" )
const ( CtFloat32 ColumnType = "f32" CtFloat64 ColumnType = "f64" )
const ( CtInt8 ColumnType = "i8" CtInt16 ColumnType = "i16" CtInt32 ColumnType = "i32" CtInt64 ColumnType = "i64" )
const ( CtTime ColumnType = "t" CtTimeZ ColumnType = "tz" )
const ( CtUint8 ColumnType = "u8" CtUint16 ColumnType = "u16" CtUint32 ColumnType = "u32" CtUint64 ColumnType = "u64" )
const (
CtBid ColumnType = "bid"
)
const (
CtDate ColumnType = "d"
)
type ColumnValidator ¶
type ColumnWriter ¶
type CsvDataBridge ¶
type CsvDataBridge struct { UidColumns []int Columns []*Column Log logging.Logger // contains filtered or unexported fields }
func (*CsvDataBridge) IsRunning ¶
func (this *CsvDataBridge) IsRunning() bool
func (*CsvDataBridge) Start ¶
func (this *CsvDataBridge) Start(done func()) (stop task.Stoper, err error)
func (*CsvDataBridge) Stop ¶
func (this *CsvDataBridge) Stop()
type CsvRecordReader ¶
type CsvRecordReader struct {
// contains filtered or unexported fields
}
func NewCsvReadDecode ¶
func NewCsvReadDecode(ed *Decoder, r *csv.Reader) *CsvRecordReader
func (*CsvRecordReader) Read ¶
func (this *CsvRecordReader) Read() (rec Recorde, err error)
type CsvRecordWriter ¶
type CsvRecordWriter struct { OnlyColumnNames bool // contains filtered or unexported fields }
func NewCsvRecordWriter ¶
func NewCsvRecordWriter(enc *Encoder, w *csv.Writer) *CsvRecordWriter
func (*CsvRecordWriter) Write ¶
func (this *CsvRecordWriter) Write(rec Recorde) (err error)
type CsvStreamReader ¶
type CsvStreamReader struct {
// contains filtered or unexported fields
}
func NewCsvStreamReader ¶
func NewCsvStreamReader(r *csv.Reader, opts ...*CsvStreamReaderOptions) *CsvStreamReader
func (*CsvStreamReader) Open ¶
func (this *CsvStreamReader) Open() (header *ReadHeader, it RecordsIterator, err error)
func (*CsvStreamReader) RecordeCount ¶
func (this *CsvStreamReader) RecordeCount() int
type CsvStreamReaderIterator ¶
type CsvStreamReaderIterator struct {
// contains filtered or unexported fields
}
func (CsvStreamReaderIterator) Done ¶
func (CsvStreamReaderIterator) Done(state interface{}) (ok bool)
func (CsvStreamReaderIterator) Next ¶
func (CsvStreamReaderIterator) Next(state interface{}) (rec Recorde, newState interface{}, err error)
func (*CsvStreamReaderIterator) Start ¶
func (this *CsvStreamReaderIterator) Start() (state interface{}, err error)
type CsvStreamReaderOptions ¶
type CsvStreamWriter ¶
type CsvStreamWriter struct { OnlyColumnNames bool OnlyRecords bool BeforeRecordeWrite, AfterRecordWrite func(w *CsvStreamWriter, rec Recorde) (err error) // contains filtered or unexported fields }
func NewCsvStreamWriter ¶
func NewCsvStreamWriter(opt CsvStreamWriterOptions, w *csv.Writer) *CsvStreamWriter
func (*CsvStreamWriter) Close ¶
func (this *CsvStreamWriter) Close() (err error)
func (*CsvStreamWriter) Columns ¶
func (this *CsvStreamWriter) Columns() []*Column
func (*CsvStreamWriter) CsvWriter ¶
func (this *CsvStreamWriter) CsvWriter() *csv.Writer
func (*CsvStreamWriter) Encoder ¶
func (this *CsvStreamWriter) Encoder() *Encoder
func (*CsvStreamWriter) Failed ¶
func (this *CsvStreamWriter) Failed() bool
func (*CsvStreamWriter) Last ¶
func (this *CsvStreamWriter) Last() Recorde
func (*CsvStreamWriter) RecordsCount ¶
func (this *CsvStreamWriter) RecordsCount() int64
func (*CsvStreamWriter) Write ¶
func (this *CsvStreamWriter) Write(rec Recorde) (err error)
type CsvStreamWriterOptions ¶
type Decoder ¶
func (*Decoder) BinReadLoopN ¶
type InputCmdStoper ¶
type InputCmdStoper struct { Input *InputCmd // contains filtered or unexported fields }
func (*InputCmdStoper) IsRunning ¶
func (this *InputCmdStoper) IsRunning() bool
func (*InputCmdStoper) Stop ¶
func (this *InputCmdStoper) Stop()
type JsonRecordWriter ¶
type JsonRecordWriter struct {
*JsonWriterConfig
}
func NewJsonRecordWriter ¶
func NewJsonRecordWriter(config *JsonWriterConfig) *JsonRecordWriter
func (*JsonRecordWriter) Write ¶
func (this *JsonRecordWriter) Write(rec Recorde) (err error)
type JsonStreamWriter ¶
type JsonStreamWriter struct { Config *JsonStreamWriterConfig // contains filtered or unexported fields }
func NewJsonStreamWriter ¶
func NewJsonStreamWriter(config *JsonStreamWriterConfig) *JsonStreamWriter
func (*JsonStreamWriter) Close ¶
func (this *JsonStreamWriter) Close() (err error)
func (*JsonStreamWriter) Columns ¶
func (this *JsonStreamWriter) Columns() []*Column
func (*JsonStreamWriter) Encoder ¶
func (this *JsonStreamWriter) Encoder() *Encoder
func (*JsonStreamWriter) Failed ¶
func (this *JsonStreamWriter) Failed() bool
func (*JsonStreamWriter) RecordsCount ¶
func (this *JsonStreamWriter) RecordsCount() int64
func (*JsonStreamWriter) Write ¶
func (this *JsonStreamWriter) Write(rec Recorde) (err error)
type JsonStreamWriterConfig ¶
type JsonStreamWriterConfig struct { JsonWriterConfig OnlyRecords bool IndentLevel int }
type JsonWriterConfig ¶
type LimitColumnTool ¶
type LimitColumnTool struct{}
func (LimitColumnTool) Limited ¶
func (LimitColumnTool) Limited() bool
type MemCacheReader ¶
type MemCacheReader struct {
// contains filtered or unexported fields
}
func NewMemCacheReader ¶
func NewMemCacheReader(r io.Reader) *MemCacheReader
type ReadHeader ¶
func NewReadHeader ¶
func NewReadHeader() *ReadHeader
func (*ReadHeader) Add ¶
func (this *ReadHeader) Add(col ...*Column) error
func (*ReadHeader) Get ¶
func (this *ReadHeader) Get(name string, recorde Recorde) interface{}
type RecordReader ¶
type RecordWriter ¶
type RecordsIterator ¶
type RecordsIteratorOpener ¶
type RecordsIteratorOpener interface {
Open() (header *ReadHeader, it RecordsIterator, err error)
}
type StreamReaderOptions ¶
type TimeZero ¶
type TimeZero struct{ UnLimitColumnTool }
type ToolDateTimer ¶
type ToolZonedTimer ¶
type ToolZonedTimer interface {
Zone(value interface{}) (h, m int)
}
type UnLimitColumnTool ¶
type UnLimitColumnTool struct{}
func (UnLimitColumnTool) Limited ¶
func (UnLimitColumnTool) Limited() bool
Source Files ¶
- api.go
- bin.go
- cache.go
- column.go
- columntool.go
- colunhelper.go
- csvdatabridge.go
- ctBid.go
- ctBoolAndString.go
- ctDate.go
- ctDateTime.go
- ctFloat.go
- ctInt.go
- ctTime.go
- ctUint.go
- db.go
- decoder.go
- encoder.go
- helpers.go
- inputCmd.go
- io.go
- ioBin.go
- ioBinStream.go
- ioBinStreamReader.go
- ioBinStreamWriter.go
- ioCsv.go
- ioCsvStream.go
- ioCsvStreamReader.go
- ioCsvStreamWriter.go
- ioJson.go
- ioJsonStream.go
- ioJsonStreamWriter.go
- iterator.go
Click to show internal directories.
Click to hide internal directories.