Documentation ¶
Index ¶
- Variables
- func ConvertAssign(dest interface{}, src []byte) error
- func DataScanBytes(key []string, data [][][]byte, v interface{}, ...) (int, error)
- func DataScanChannel(key []string, data chan [][]byte, v interface{}, ...) (int, error)
- func MakeFieldName(tag string) func(fn reflect.StructField) string
- func RowsLimitBytes(rows Rows, limit int) ([]string, [][][]byte, error)
- func RowsLimitChannel(rows Rows, limit int) ([]string, chan [][]byte, error)
- func RowsScan(rows Rows, v interface{}, limit int, fn func(reflect.StructField) string, ...) (int, error)
- func RowsScanBytes(rows Rows, v interface{}, limit int, fn func(reflect.StructField) string) (int, error)
- func RowsScanChannel(rows Rows, v interface{}, limit int, fn func(reflect.StructField) string, ...) (int, error)
- func StringToBytes(v string) []byte
- func StringsToBytess(v []string) [][]byte
- func StringssToBytesss(v [][]string) [][][]byte
- type Rows
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidType = errors.New("Invalid type") ErrNotPointer = errors.New("Destination not a pointer") ErrPointerNil = errors.New("destination pointer is nil") )
Some common error definitions
var ( MaxForkSize = 16 MakeSliceCap = 1024 * 16 MaxBuffer = 1024 )
Some global parameters
Functions ¶
func ConvertAssign ¶
ConvertAssign copies to dest the value in src, converting it if possible. An error is returned if the copy would result in loss of information. dest should be a pointer type.
func DataScanBytes ¶
func DataScanBytes(key []string, data [][][]byte, v interface{}, fn func(reflect.StructField) string) (int, error)
DataScanBytes fill in key and data to v
func DataScanChannel ¶
func DataScanChannel(key []string, data chan [][]byte, v interface{}, fn func(reflect.StructField) string, f int) (int, error)
DataScanChannel fill in key and data to v
func MakeFieldName ¶
func MakeFieldName(tag string) func(fn reflect.StructField) string
MakeFieldName returns a function that gets the value of a field
func RowsLimitBytes ¶
RowsLimitBytes if limit >= 0 Read maximum rows limit else < 0 Not limited
func RowsLimitChannel ¶
RowsLimitChannel if limit >= 0 Read maximum rows limit else < 0 Not limited
func RowsScan ¶
func RowsScan(rows Rows, v interface{}, limit int, fn func(reflect.StructField) string, f int) (int, error)
RowsScan v should be a pointer type. SupportType:
Basic Type Slices Array Pointer Struct map[string]string *map[string]string map[string][]byte *map[string][]byte
Example:
[100]map[string]string Get 100 lines to map map[string]string Get 1 lines to map []*struct All to *struct *[100]struct Get 100 lines to struct var ret [100]map[string]string DataScan(key, data, &ret)
func RowsScanBytes ¶
func RowsScanBytes(rows Rows, v interface{}, limit int, fn func(reflect.StructField) string) (int, error)
RowsScanBytes fill in rows to v
func RowsScanChannel ¶
func RowsScanChannel(rows Rows, v interface{}, limit int, fn func(reflect.StructField) string, f int) (int, error)
RowsScanChannel fill in rows to v
func StringToBytes ¶ added in v1.0.3
StringToBytes string to []byte
func StringsToBytess ¶ added in v1.0.3
StringsToBytess []string to [][]byte
func StringssToBytesss ¶ added in v1.0.3
StringssToBytesss [][]string to [][][]byte