mapper

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 29, 2016 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build(rows api.Rows, sType reflect.Type) (interface{}, error)

Build takes the next value from Rows and uses it to create a new instance of the specified type If the type is a primitive and there are more than 1 values in the current row, only the first value is used. If the type is a map of string to interface, then the column names are the keys in the map and the values are assigned If the type is a struct that has gdbp tags on its fields, then any matching tags will be associated with values with the associate columns Any non-associated values will be set to the zero value If any columns cannot be assigned to any types, then an error is returned If next returns false, then nil is returned for both the interface and the error If an error occurs while processing the current row, nil is returned for the interface and the error is non-nil If a value is successfuly extracted from the current row, the instance is returned and the error is nil

func Extract

func Extract(s interface{}, path []string) (interface{}, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL