Documentation ¶
Index ¶
- func EncodeGob(output string, pkg *Package) error
- func IsProcessRower(s interface{}) bool
- func LookAtFuncParameters(mt reflect.Type) (Parameters, Parameters)
- type Field
- type Fields
- type ImportElement
- type Interface
- type InterfaceElement
- type Interfaces
- type Method
- type Methods
- type Package
- type Parameter
- type Parameters
- type SliceElement
- type StructElement
- type UnsupportedElement
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsProcessRower ¶ added in v0.6.0
func IsProcessRower(s interface{}) bool
func LookAtFuncParameters ¶
func LookAtFuncParameters(mt reflect.Type) (Parameters, Parameters)
Types ¶
type Field ¶
type Field struct { // See the fields that describe Req struct. // type Req struct { // ID int64 `sql:"id"` // } // for Req.ID Name contains `ID`. Name string // ImportPath contains ImportElement. ImportPath ImportElement // for Req.ID BaseType contains `int64`. BaseType string // UserType contains type other then basic if it's defined otherwise basic. UserType string // Anonymous sets to true if field contains anonymous nested struct. Anonymous bool // Tag contains the value for tag with name `sql` if it's presented. Tag string // todo Parents []string }
Field describes the fields of struct after reflection.
func (Field) ColumnName ¶ added in v0.4.0
ColumnName returns the column name to use for mapping with sql response.
type Fields ¶
type Fields []Field
Fields is alias for slice of Field.
func LookAtField ¶
func LookAtField(ft reflect.StructField) Fields
LookAtField receive the reflected object of struct field and return Fields. If field points to anonymous struct then LookAtFields will be called.
func LookAtFields ¶
LookAtFields receives the reflect.Type object of struct and returns the Fields.
type ImportElement ¶
ImportElement represents the imported package. Attribute `Alias` represents the optional alias for the package.
import foo "github.com/fooooo/baaaar-pppkkkkggg"
func GetImportElement ¶ added in v0.11.0
func GetImportElement(typ reflect.Type) ImportElement
func (ImportElement) Name ¶
func (ie ImportElement) Name() string
type Interface ¶
type Interface struct { ImportPath ImportElement UserType string Methods Methods }
func LookAtInterface ¶
func (*Interface) ImplementationName ¶ added in v0.9.1
func (*Interface) ImportPaths ¶ added in v0.11.0
type InterfaceElement ¶ added in v0.2.0
type InterfaceElement struct { ImportPath ImportElement UserType string }
func (*InterfaceElement) ImportPaths ¶ added in v0.11.0
func (prm *InterfaceElement) ImportPaths() []string
func (*InterfaceElement) Kind ¶ added in v0.2.0
func (prm *InterfaceElement) Kind() string
func (*InterfaceElement) Name ¶ added in v0.2.0
func (prm *InterfaceElement) Name(dstPath string) string
func (*InterfaceElement) Pointer ¶ added in v0.2.0
func (prm *InterfaceElement) Pointer() bool
type Interfaces ¶
type Interfaces []*Interface
type Method ¶
type Method struct { Name string In Parameters Out Parameters }
func (*Method) ImportPaths ¶ added in v0.11.0
type Package ¶
type Package struct { ImportPath ImportElement Interfaces Interfaces }
func (*Package) ImportPaths ¶ added in v0.11.0
type Parameter ¶
type Parameter interface { Kind() string Name(dstPath string) string Pointer() bool ImportPaths() []string }
func LookAtParameter ¶
type Parameters ¶
type Parameters []Parameter
type SliceElement ¶ added in v0.2.0
type SliceElement struct { ImportPath ImportElement UserType string Item Parameter IsPointer bool }
func (*SliceElement) ImportPaths ¶ added in v0.11.0
func (prm *SliceElement) ImportPaths() []string
func (*SliceElement) Kind ¶ added in v0.2.0
func (prm *SliceElement) Kind() string
func (*SliceElement) Name ¶ added in v0.2.0
func (prm *SliceElement) Name(dstPath string) string
func (*SliceElement) Pointer ¶ added in v0.2.0
func (prm *SliceElement) Pointer() bool
type StructElement ¶
type StructElement struct { ImportPath ImportElement UserType string IsPointer bool Fields Fields ProcessRower bool }
Use exported fields because god.Encoder
func (*StructElement) ImportPaths ¶ added in v0.11.0
func (prm *StructElement) ImportPaths() []string
todo: import path for fields
func (*StructElement) Kind ¶
func (prm *StructElement) Kind() string
func (*StructElement) Name ¶
func (prm *StructElement) Name(dstPath string) string
func (*StructElement) Pointer ¶
func (prm *StructElement) Pointer() bool
type UnsupportedElement ¶ added in v0.2.0
type UnsupportedElement struct { ImportPath ImportElement UserType string BaseType string IsPointer bool }
func (*UnsupportedElement) ImportPaths ¶ added in v0.11.0
func (prm *UnsupportedElement) ImportPaths() []string
func (*UnsupportedElement) Kind ¶ added in v0.2.0
func (prm *UnsupportedElement) Kind() string
func (*UnsupportedElement) Name ¶ added in v0.2.0
func (prm *UnsupportedElement) Name(dstPath string) string
func (*UnsupportedElement) Pointer ¶ added in v0.2.0
func (prm *UnsupportedElement) Pointer() bool
Click to show internal directories.
Click to hide internal directories.