Documentation ¶
Index ¶
- Constants
- Variables
- type Annotation
- type Annotations
- type BiCondition
- type Condition
- type EntityInfo
- type FieldCondition
- type FieldInfo
- type FieldsInfo
- type GenType
- type Import
- type Imports
- type InterfaceInfo
- func (i *InterfaceInfo) AddMethod(m *MethodInfo)
- func (i *InterfaceInfo) ExistMethod(n *MethodInfo) bool
- func (i *InterfaceInfo) FullName() string
- func (i *InterfaceInfo) GetAnnotation(name string) *Annotation
- func (i *InterfaceInfo) GetMethod(name string) (*MethodInfo, bool)
- func (i *InterfaceInfo) ModelName() string
- func (i *InterfaceInfo) Visit(node ast.Node) ast.Visitor
- type InterfaceMethods
- type MethodInfo
- type Package
- type PackageInfo
- type StructInfo
Constants ¶
View Source
const (
AnnotationName = "name" //entityName
)
Variables ¶
View Source
var BaseCrudInterface = NewInterfaceInfo("BaseCrudInterface", &Package{ PackageInfo: PackageInfo{ Name: "db_gorm", Path: "gitee.com/lipore/plume/db_gorm", }, })
View Source
var ErrMethodConflict = errors.New("method conflict")
Functions ¶
This section is empty.
Types ¶
type Annotation ¶
func NewAnnotation ¶
func NewAnnotation(annotationString string) *Annotation
type Annotations ¶
type Annotations map[string]*Annotation
func NewAnnotations ¶
func NewAnnotations() *Annotations
func (*Annotations) Get ¶
func (a *Annotations) Get(name string) (*Annotation, bool)
func (*Annotations) Len ¶
func (a *Annotations) Len() int
func (*Annotations) Set ¶
func (a *Annotations) Set(name, value string)
type BiCondition ¶
type Condition ¶
type Condition interface { }
func ParseCondition ¶
ParseCondition parse condition string to Condition
type EntityInfo ¶
type EntityInfo struct { IdFields []*FieldInfo DalStruct *StructInfo DalDIYDoInterface *InterfaceInfo DalInterface *InterfaceInfo }
func NewEntityInfo ¶
func NewEntityInfo(dalStru *StructInfo, diyDo *InterfaceInfo, pkg *Package) *EntityInfo
func (*EntityInfo) Column ¶
func (e *EntityInfo) Column(name string) *FieldInfo
type FieldCondition ¶
type FieldsInfo ¶
type FieldsInfo []*FieldInfo
type InterfaceInfo ¶
type InterfaceInfo struct { Name string Methods []*MethodInfo Annotations *Annotations ParentInterface *InterfaceInfo Package *PackageInfo }
InterfaceInfo is the interface info
func NewInterfaceInfo ¶
func NewInterfaceInfo(name string, pkg *Package) *InterfaceInfo
func (*InterfaceInfo) AddMethod ¶
func (i *InterfaceInfo) AddMethod(m *MethodInfo)
func (*InterfaceInfo) ExistMethod ¶
func (i *InterfaceInfo) ExistMethod(n *MethodInfo) bool
func (*InterfaceInfo) FullName ¶
func (i *InterfaceInfo) FullName() string
func (*InterfaceInfo) GetAnnotation ¶
func (i *InterfaceInfo) GetAnnotation(name string) *Annotation
func (*InterfaceInfo) GetMethod ¶
func (i *InterfaceInfo) GetMethod(name string) (*MethodInfo, bool)
func (*InterfaceInfo) ModelName ¶
func (i *InterfaceInfo) ModelName() string
type InterfaceMethods ¶
type InterfaceMethods []*MethodInfo
type MethodInfo ¶
type MethodInfo struct { Name string RecvType string // must be nil for interface method Params FieldsInfo Results FieldsInfo }
MethodInfo is the method info
func (*MethodInfo) Equal ¶
func (m *MethodInfo) Equal(n *MethodInfo) bool
type Package ¶
type Package struct { PackageInfo InterfaceInfos map[string]*InterfaceInfo StructInfos map[string]*StructInfo }
Package is the package info
func NewPackage ¶
type PackageInfo ¶
type StructInfo ¶
type StructInfo struct { Name string Fields FieldsInfo Methods []*MethodInfo Annotations *Annotations Package *PackageInfo }
StructInfo is the struct info
func NewStructInfo ¶
func NewStructInfo(name string, pkg *Package) *StructInfo
func (*StructInfo) GetAnnotation ¶
func (s *StructInfo) GetAnnotation(name string) *Annotation
func (*StructInfo) GetMethod ¶
func (s *StructInfo) GetMethod(name string) (*MethodInfo, bool)
func (*StructInfo) ModelName ¶
func (s *StructInfo) ModelName() string
ModelName return the name of the model of the DataObject
Click to show internal directories.
Click to hide internal directories.