Documentation ¶
Index ¶
- type EmptyMap
- func (emr *EmptyMap) GetMap(row, column int) (map[string]interface{}, error)
- func (emr *EmptyMap) GetMapByName(row int, name string) (map[string]interface{}, error)
- func (emr *EmptyMap) GetMapFloat(row, column int) (map[string]float64, error)
- func (emr *EmptyMap) GetMapFloatByName(row int, name string) (map[string]float64, error)
- func (emr *EmptyMap) GetMapInt(row, column int) (map[string]int, error)
- func (emr *EmptyMap) GetMapIntByName(row int, name string) (map[string]int, error)
- func (emr *EmptyMap) GetMapString(row, column int) (map[string]string, error)
- func (emr *EmptyMap) GetMapStringByName(row int, name string) (map[string]string, error)
- func (emr *EmptyMap) GetMapUint(row, column int) (map[string]uint, error)
- func (emr *EmptyMap) GetMapUintByName(row int, name string) (map[string]uint, error)
- type EmptyMetadata
- type EmptySlice
- func (esr *EmptySlice) GetFloatSlice(row, column int) ([]float64, error)
- func (esr *EmptySlice) GetFloatSliceByName(row int, name string) ([]float64, error)
- func (esr *EmptySlice) GetIntSlice(row, column int) ([]int, error)
- func (esr *EmptySlice) GetIntSliceByName(row int, name string) ([]int, error)
- func (esr *EmptySlice) GetSlice(row, column int) ([]interface{}, error)
- func (esr *EmptySlice) GetSliceByName(row int, name string) ([]interface{}, error)
- func (esr *EmptySlice) GetStringSlice(row, column int) ([]string, error)
- func (esr *EmptySlice) GetStringSliceByName(row int, name string) ([]string, error)
- func (esr *EmptySlice) GetUintSlice(row, column int) ([]uint, error)
- func (esr *EmptySlice) GetUintSliceByName(row int, name string) ([]uint, error)
- type Map
- type Metadata
- type Number
- type Raw
- type Rows
- func (r *Rows) ColumnExists(name string) bool
- func (r *Rows) ColumnNumber() int
- func (r *Rows) GetFloat(row, column int) (float64, error)
- func (r *Rows) GetFloatByName(row int, name string) (float64, error)
- func (r *Rows) GetFloatSlice(row, column int) ([]float64, error)
- func (r *Rows) GetFloatSliceByName(row int, name string) ([]float64, error)
- func (r *Rows) GetInt(row, column int) (int, error)
- func (r *Rows) GetIntByName(row int, name string) (int, error)
- func (r *Rows) GetIntSlice(row, column int) ([]int, error)
- func (r *Rows) GetIntSliceByName(row int, name string) ([]int, error)
- func (r *Rows) GetSlice(row, column int) ([]interface{}, error)
- func (r *Rows) GetSliceByName(row int, name string) ([]interface{}, error)
- func (r *Rows) GetString(row, column int) (string, error)
- func (r *Rows) GetStringByName(row int, name string) (string, error)
- func (r *Rows) GetStringSlice(row, column int) ([]string, error)
- func (r *Rows) GetStringSliceByName(row int, name string) ([]string, error)
- func (r *Rows) GetUint(row, column int) (uint, error)
- func (r *Rows) GetUintByName(row int, name string) (uint, error)
- func (r *Rows) GetUintSlice(row, column int) ([]uint, error)
- func (r *Rows) GetUintSliceByName(row int, name string) ([]uint, error)
- func (r *Rows) GetValue(row, column int) (interface{}, error)
- func (r *Rows) GetValueByName(row int, name string) (interface{}, error)
- func (r *Rows) IsNull(row, column int) (bool, error)
- func (r *Rows) IsNullByName(row int, name string) (bool, error)
- func (r *Rows) MapToStructByRowIndex(in interface{}, row int, tag string) error
- func (r *Rows) MapToStructSlice(in interface{}, tag string) error
- func (r *Rows) NameIndex(name string) (int, error)
- func (r *Rows) RowNumber() int
- type Slice
- type String
- type Unmarshaler
- type Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EmptyMap ¶
type EmptyMap struct {
MiddlewareType string
}
func NewEmptyMap ¶
NewEmptyMap returns *EmptyMap with given middleware type
func (*EmptyMap) GetMap ¶
GetMap always returns error, because middleware does not support map data type, this function is only for implementing the middleware.Result interface
func (*EmptyMap) GetMapByName ¶
GetMapByName always returns error, because middleware does not support map data type, this function is only for implementing the middleware.Result interface
func (*EmptyMap) GetMapFloat ¶
GetMapFloat always returns error, because middleware does not support map data type, this function is only for implementing the middleware.Result interface
func (*EmptyMap) GetMapFloatByName ¶
GetMapFloatByName always returns error, because middleware does not support map data type, this function is only for implementing the middleware.Result interface
func (*EmptyMap) GetMapInt ¶
GetMapInt always returns error, because middleware does not support map data type, this function is only for implementing the middleware.Result interface
func (*EmptyMap) GetMapIntByName ¶
GetMapIntByName always returns error, because middleware does not support map data type, this function is only for implementing the middleware.Result interface
func (*EmptyMap) GetMapString ¶
GetMapString always returns error, because middleware does not support map data type, this function is only for implementing the middleware.Result interface
func (*EmptyMap) GetMapStringByName ¶
GetMapStringByName always returns error, because middleware does not support map data type, this function is only for implementing the middleware.Result interface
func (*EmptyMap) GetMapUint ¶
GetMapUint always returns error, because middleware does not support map data type, this function is only for implementing the middleware.Result interface
type EmptyMetadata ¶
type EmptyMetadata struct {
MiddlewareType string
}
func NewEmptyMetadata ¶
func NewEmptyMetadata(middlewareType string) *EmptyMetadata
NewEmptyMetadata returns *EmptyMetadata with given middleware type
func (*EmptyMetadata) LastInsertID ¶
func (em *EmptyMetadata) LastInsertID() (int, error)
LastInsertID always returns error, because middleware does not support Metadata, this function is only for implementing the middleware.Result interface
func (*EmptyMetadata) RowsAffected ¶
func (em *EmptyMetadata) RowsAffected() (int, error)
RowsAffected always returns error, because middleware does not support Metadata, this function is only for implementing the middleware.Result interface
type EmptySlice ¶
type EmptySlice struct {
MiddlewareType string
}
func NewEmptySlice ¶
func NewEmptySlice(middlewareType string) *EmptySlice
NewEmptySlice returns *EmptySlice with given middleware type
func (*EmptySlice) GetFloatSlice ¶
func (esr *EmptySlice) GetFloatSlice(row, column int) ([]float64, error)
GetFloatSlice always returns error, because middleware does not support slice type this function is only for implementing the middleware.Result interface
func (*EmptySlice) GetFloatSliceByName ¶
func (esr *EmptySlice) GetFloatSliceByName(row int, name string) ([]float64, error)
GetFloatSliceByName always returns error, because middleware does not support slice type this function is only for implementing the middleware.Result interface
func (*EmptySlice) GetIntSlice ¶
func (esr *EmptySlice) GetIntSlice(row, column int) ([]int, error)
GetIntSlice always returns error, because middleware does not support slice type this function is only for implementing the middleware.Result interface
func (*EmptySlice) GetIntSliceByName ¶
func (esr *EmptySlice) GetIntSliceByName(row int, name string) ([]int, error)
GetIntSliceByName always returns error, because middleware does not support slice type this function is only for implementing the middleware.Result interface
func (*EmptySlice) GetSlice ¶
func (esr *EmptySlice) GetSlice(row, column int) ([]interface{}, error)
GetSlice always returns error, because middleware does not support slice type this function is only for implementing the middleware.Result interface
func (*EmptySlice) GetSliceByName ¶
func (esr *EmptySlice) GetSliceByName(row int, name string) ([]interface{}, error)
GetSliceByName always returns error, because middleware does not support slice type this function is only for implementing the middleware.Result interface
func (*EmptySlice) GetStringSlice ¶
func (esr *EmptySlice) GetStringSlice(row, column int) ([]string, error)
GetStringSlice always returns error, because middleware does not support slice type this function is only for implementing the middleware.Result interface
func (*EmptySlice) GetStringSliceByName ¶
func (esr *EmptySlice) GetStringSliceByName(row int, name string) ([]string, error)
GetStringSliceByName always returns error, because middleware does not support slice type this function is only for implementing the middleware.Result interface
func (*EmptySlice) GetUintSlice ¶
func (esr *EmptySlice) GetUintSlice(row, column int) ([]uint, error)
GetUintSlice always returns error, because middleware does not support slice type this function is only for implementing the middleware.Result interface
func (*EmptySlice) GetUintSliceByName ¶
func (esr *EmptySlice) GetUintSliceByName(row int, name string) ([]uint, error)
GetUintSliceByName always returns error, because middleware does not support slice type this function is only for implementing the middleware.Result interface
type Map ¶
type Map interface { GetMap(row, column int) (map[string]interface{}, error) GetMapByName(row int, name string) (map[string]interface{}, error) GetMapUint(row, column int) (map[string]uint, error) GetMapUintByName(row int, name string) (map[string]uint, error) GetMapInt(row, column int) (map[string]int, error) GetMapIntByName(row int, name string) (map[string]int, error) GetMapFloat(row, column int) (map[string]float64, error) GetMapFloatByName(row int, name string) (map[string]float64, error) GetMapString(row, column int) (map[string]string, error) GetMapStringByName(row int, name string) (map[string]string, error) }
type Number ¶
type Number interface { // GetUint returns uint type value of given row and column number GetUint(row, column int) (uint, error) // GetUintByName returns uint type value of given row number and column name GetUintByName(row int, name string) (uint, error) // GetInt returns int type value of given row and column number GetInt(row, column int) (int, error) // GetIntByName returns int type value of given row number and column name GetIntByName(row int, name string) (int, error) // GetFloat returns float64 type value of given row and column number GetFloat(row, column int) (float64, error) // GetFloatByName returns float64 type value of given row number and column name GetFloatByName(row int, name string) (float64, error) }
type Raw ¶ added in v0.3.3
type Raw interface {
// GetRaw returns the raw data of the result
GetRaw() interface{}
}
type Rows ¶
func NewRowsWithRows ¶
NewRowsWithRows returns *Rows, it builds from given rows
func (*Rows) ColumnExists ¶
ColumnExists check if column exists in the result
func (*Rows) ColumnNumber ¶
ColumnNumber returns how many columns in the result
func (*Rows) GetFloatByName ¶
GetFloatByName returns float64 type value of given row number and column name
func (*Rows) GetFloatSlice ¶
GetFloatSlice returns []float64 type value of given row and column number
func (*Rows) GetFloatSliceByName ¶
GetFloatSliceByName returns []float64 type value of given row number and column name
func (*Rows) GetIntByName ¶
GetIntByName returns int type value of given row number and column name
func (*Rows) GetIntSlice ¶
GetIntSlice returns []uint64 type value of given row and column number
func (*Rows) GetIntSliceByName ¶
GetIntSliceByName returns []int64 type value of given row number and column name
func (*Rows) GetSliceByName ¶
GetSliceByName returns []interface type value of given row number and column name
func (*Rows) GetStringByName ¶
GetStringByName returns string type value of given row number and column name
func (*Rows) GetStringSlice ¶
GetStringSlice returns []string type value of given row and column number
func (*Rows) GetStringSliceByName ¶
GetStringSliceByName returns []string type value of given row number and column name
func (*Rows) GetUintByName ¶
GetUintByName returns uint type value of given row number and column name
func (*Rows) GetUintSlice ¶
GetUintSlice returns []uint type value of given row and column number
func (*Rows) GetUintSliceByName ¶
GetUintSliceByName returns []uint64 type value of given row number and column name
func (*Rows) GetValueByName ¶
GetValueByName returns interface{} type value of given row number and column name
func (*Rows) IsNullByName ¶
IsNullByName checks if value of given row number and column name is nil
func (*Rows) MapToStructByRowIndex ¶
MapToStructByRowIndex maps row of given index result to the struct first argument must be a pointer to struct, each column in the row maps to a field of the struct, tag argument is the tag of the field, it represents the column name, if there is no such tag in the field, this field will be ignored, so set tag to each field that need to be mapped, using "middleware" as the tag is recommended.
func (*Rows) MapToStructSlice ¶
MapToStructSlice maps each row to a struct of the first argument, first argument must be a slice of pointers to structs, each row in the result maps to a struct in the slice, each column in the row maps to a field of the struct, tag argument is the tag of the field, it represents the column name, if there is no such tag in the field, this field will be ignored, so set tag to each field that need to be mapped, using "middleware" as the tag is recommended.
type Slice ¶
type Slice interface { GetSlice(row, column int) ([]interface{}, error) GetSliceByName(row int, name string) ([]interface{}, error) GetUintSlice(row, column int) ([]uint, error) GetUintSliceByName(row int, name string) ([]uint, error) GetIntSlice(row, column int) ([]int, error) GetIntSliceByName(row int, name string) ([]int, error) GetFloatSlice(row, column int) ([]float64, error) GetFloatSliceByName(row int, name string) ([]float64, error) GetStringSlice(row, column int) ([]string, error) GetStringSliceByName(row int, name string) ([]string, error) }
type Unmarshaler ¶
type Unmarshaler interface { // MapToStructSlice maps each row to a struct of the first argument, // first argument must be a slice of pointers to structs, // each row in the result maps to a struct in the slice, // each column in the row maps to a field of the struct, // tag argument is the tag of the field, it represents the column name, // if there is no such tag in the field, this field will be ignored, // so set tag to each field that need to be mapped, // using "middleware" as the tag is recommended. MapToStructSlice(in interface{}, tag string) error // MapToStructByRowIndex maps row of given index result to the struct // first argument must be a pointer to struct, // each column in the row maps to a field of the struct, // tag argument is the tag of the field, it represents the column name, // if there is no such tag in the field, this field will be ignored, // so set tag to each field that need to be mapped, // using "middleware" as the tag is recommended. MapToStructByRowIndex(in interface{}, row int, tag string) error }
type Value ¶
type Value interface { // RowNumber returns how many rows in the result RowNumber() int // ColumnNumber return how many columns in the result ColumnNumber() int // GetValue returns interface{} type value of given row and column number GetValue(row, column int) (interface{}, error) // ColumnExists check if column exists in the result ColumnExists(name string) bool // NameIndex returns number of given column NameIndex(name string) (int, error) // GetValueByName returns interface{} type value of given row number and column name GetValueByName(row int, name string) (interface{}, error) // IsNull checks if value of given row and column number is nil IsNull(row, column int) (bool, error) // IsNullByName checks if value of given row number and column name is nil IsNullByName(row int, name string) (bool, error) }