Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FieldMapping ¶
type FieldMapping struct {
// Name is the Go field name
Name string
// ReadColDef is the read column definition (nil if not given)
ReadColDef *ReadColDef
// WriteColDef is the write column definition (nil if not given)
WriteColDef *WriteColDef
// FieldType is the type in the Go struct
FieldType types.Type
}
FieldMapping contains mapping information for a field of a mapping
type ReadColDef ¶
type ReadColDef struct {
// Col is the column name
Col string
// Sortable is true, if the column should appear in the list of sortable columns
Sortable bool
}
ReadColDef is the read column definition
type StructMapping ¶
type StructMapping struct {
// TargetName is the exported record name (e.g. "MyRecord")
TargetName string
// MappingTypePackage is the package of the type with mapping information
MappingTypePackage string
// MappingTypePackage is the name of the type with mapping information
MappingTypeName string
// FieldMappings contains all field mappings derived from the type
FieldMappings []FieldMapping
}
StructMapping contains mapping information for a struct type
func BuildStructMapping ¶
func BuildStructMapping(mappingTypePackage string, mappingTypeName string, targetTypeName string) (*StructMapping, error)
BuildStructMapping builds a struct mapping for a given mapping type and target type
func DiscoverStructMappings ¶ added in v0.6.0
func DiscoverStructMappings(mappingTypePackage string) (mappings []*StructMapping, err error)
DiscoverStructMappings discovers all struct mappings in a given package
type WriteColDef ¶
type WriteColDef struct {
// Col is the column name
Col string
// ToJSON when writing a column value
ToJSON bool
}
WriteColDef is the write column definition
Directories
¶
| Path | Synopsis |
|---|---|
|
repository
Code generated by construct, DO NOT EDIT.
|
Code generated by construct, DO NOT EDIT. |
Click to show internal directories.
Click to hide internal directories.