Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrUnmarshalUnsupportedType = errors.New("only map[string]interface{} and struct pointer types are supported for unmarshalling")
View Source
var UtcCache = UnmarshalMetaCache{/* contains filtered or unexported fields */}
View Source
var UtcNoopScanner interface{} = NoOpScanner{}
Functions ¶
func NewUnmarshalTargetSlice ¶
func NewUnmarshalTargetSlice(target interface{}, cols []schema.DBColumnMeta) ([]interface{}, error)
Takes a pointer to a struct as well as a slice of column metadata, returning a slice of pointers which point at the tagged fields in target's type in the order provided in selectedCols param. This slice is for feeding as varargs to sql.Rows.Scan().
Types ¶
type NoOpScanner ¶
type NoOpScanner struct{}
Placeholder for columns which have no corresponding field in the target struct.
func (*NoOpScanner) Scan ¶
func (s *NoOpScanner) Scan(src interface{}) error
type Placeholder ¶
type Placeholder struct { Col schema.DBColumnMeta Val interface{} }
placeholder implements sql.Scanner. instances of this are used as placeholder values that rows.Scan will recognize and supply each column value to them.
func (*Placeholder) Scan ¶
func (s *Placeholder) Scan(src interface{}) error
type UnmarshalMetaCache ¶
type UnmarshalMetaCache struct {
// contains filtered or unexported fields
}
func (*UnmarshalMetaCache) GetOrSet ¶
func (umc *UnmarshalMetaCache) GetOrSet(typ reflect.Type, getter UtmGetterFunc) (UnmarshalTypeMeta, error)
func (*UnmarshalMetaCache) Invalidate ¶
func (umc *UnmarshalMetaCache) Invalidate(typ reflect.Type)
type UnmarshalTypeMeta ¶
type UnmarshalTypeMeta struct {
Fields map[string]UnmarshalTypeMetaField
}
type UnmarshalTypeMetaField ¶
type UnmarshalTypeMetaField struct { Field reflect.StructField Factory unsafe.InterfaceFactory }
type UtmGetterFunc ¶
type UtmGetterFunc func(reflect.Type) (UnmarshalTypeMeta, error)
Click to show internal directories.
Click to hide internal directories.