Documentation
¶
Index ¶
- Constants
- Variables
- type AutoConversionMapper
- type ConcreteMapper
- type DbScanner
- type JsonMapper
- type Mapper
- type MapperCollection
- type ScanResults
- type ScanTarget
- func (t *ScanTarget[T]) AddAllFields(defaultMapper Mapper)
- func (t *ScanTarget[T]) AddField(name string, defaultMapper Mapper)
- func (t *ScanTarget[T]) FieldHasBeenAdded(name string) bool
- func (t *ScanTarget[T]) GetFieldValue(fieldName string) any
- func (t *ScanTarget[T]) GetReflectedModel() reflect.Value
- func (t *ScanTarget[T]) SetFieldValue(fieldName string, fieldValue any) error
- type ScanTargetField
- type Scanner
Constants ¶
View Source
const MapperTagName = "mapper"
Variables ¶
View Source
var ErrNoSuchField = errors.New("no such field")
View Source
var Mappers = NewMapperCollection()
Functions ¶
This section is empty.
Types ¶
type AutoConversionMapper ¶
type AutoConversionMapper struct {
// contains filtered or unexported fields
}
type ConcreteMapper ¶
type ConcreteMapper struct {
}
ConcreteMapper converts nil scanned values into the zero value for the corresponding type
type DbScanner ¶
type DbScanner struct {
MapperCollection *MapperCollection
}
func NewDbScanner ¶
func NewDbScanner() *DbScanner
func (*DbScanner) ScanRowsIntoStructs ¶
type JsonMapper ¶
type JsonMapper struct {
// contains filtered or unexported fields
}
type MapperCollection ¶
type MapperCollection struct {
// contains filtered or unexported fields
}
func NewMapperCollection ¶
func NewMapperCollection() *MapperCollection
func (*MapperCollection) GetMapperByName ¶
func (mc *MapperCollection) GetMapperByName(name string) Mapper
func (*MapperCollection) RegisterMapper ¶
func (mc *MapperCollection) RegisterMapper(name string, m Mapper)
type ScanResults ¶
type ScanResults [][]any
type ScanTarget ¶
type ScanTarget[T any] struct { Model T // contains filtered or unexported fields }
func CopyIntoNewScanTarget ¶
func CopyIntoNewScanTarget[T any](model T) *ScanTarget[T]
func NewScanTarget ¶
func NewScanTarget[T any](model T) *ScanTarget[T]
func (*ScanTarget[T]) AddAllFields ¶
func (t *ScanTarget[T]) AddAllFields(defaultMapper Mapper)
func (*ScanTarget[T]) AddField ¶
func (t *ScanTarget[T]) AddField(name string, defaultMapper Mapper)
func (*ScanTarget[T]) FieldHasBeenAdded ¶
func (t *ScanTarget[T]) FieldHasBeenAdded(name string) bool
func (*ScanTarget[T]) GetFieldValue ¶
func (t *ScanTarget[T]) GetFieldValue(fieldName string) any
func (*ScanTarget[T]) GetReflectedModel ¶
func (t *ScanTarget[T]) GetReflectedModel() reflect.Value
func (*ScanTarget[T]) SetFieldValue ¶
func (t *ScanTarget[T]) SetFieldValue(fieldName string, fieldValue any) error
type ScanTargetField ¶
type ScanTargetField struct {
Mapper
// contains filtered or unexported fields
}
func (*ScanTargetField) Read ¶
func (f *ScanTargetField) Read() any
func (*ScanTargetField) Scan ¶
func (f *ScanTargetField) Scan(src any) error
Click to show internal directories.
Click to hide internal directories.