Documentation ¶
Index ¶
- func GetName(names []*ast.Ident) string
- func ParseSQL(comment, dialect string) string
- func ParseSelectorExprType(se *ast.SelectorExpr, ptr bool) *objs.Type
- type Func
- func (f *Func) AddDBUtilPackage() string
- func (f *Func) AddRunTimePackage() string
- func (f *Func) AddSQLPackage() string
- func (f *Func) AddXTypePackage(fullPkgPath string) string
- func (f *Func) CreateError(format string, v ...interface{}) error
- func (f *Func) Format(format string, v ...interface{}) string
- func (f *Func) Parse(method *ast.Field, dialect string) error
- type Info
- func (m *Info) CreateImplementFilePath(fileName string) string
- func (m *Info) CreateInterfaceFilePath(fileName string) string
- func (m *Info) CreateRepositoryDirIfNotExists() error
- func (m *Info) FindRepoFiles() (err error)
- func (m *Info) GenerateImplementFilePath(fileName string) string
- func (m *Info) GenerateInterfaceFilePath(fileName string) string
- func (m *Info) IsProvidesChanged() bool
- func (m *Info) TraverseFuncs(fn func(f *Func, intf *RepoInterface, rf *RepoFile) error) error
- func (m *Info) TraverseRepoFiles(fn func(rf *RepoFile) error) error
- func (m *Info) TraverseRepos(fn func(intf *RepoInterface, rf *RepoFile) error) error
- type Object
- type RepoFile
- func (rf *RepoFile) AddDBUtilPackage() string
- func (rf *RepoFile) AddRepo(repo *RepoInterface)
- func (rf *RepoFile) AddRuntimePackage() string
- func (rf *RepoFile) AddSQLPackage() string
- func (rf *RepoFile) AddXTypePackage(pkgPath string) string
- func (rf *RepoFile) FindImport(pkg string) string
- func (rf *RepoFile) FindPackagePath(pkg string) (string, error)
- func (rf *RepoFile) Parse(dialect string) error
- type RepoInterface
- type Template
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseSelectorExprType ¶
func ParseSelectorExprType(se *ast.SelectorExpr, ptr bool) *objs.Type
Types ¶
type Func ¶
func NewFunc ¶
func NewFunc(repo *RepoInterface) *Func
func NewFuncWithObject ¶
func (*Func) AddDBUtilPackage ¶
func (*Func) AddRunTimePackage ¶
func (*Func) AddSQLPackage ¶
func (*Func) AddXTypePackage ¶
func (*Func) CreateError ¶
type Info ¶
type Info struct { Parsed bool Package string PackageName string OldRepositoriesMap map[string]bool // 从已存在的 interface.go 文件中读取的已经提供的 Repository 列表 Dir string Dialect string FSet *token.FileSet `json:"-"` Files []*RepoFile // contains filtered or unexported fields }
func (*Info) CreateImplementFilePath ¶
func (*Info) CreateInterfaceFilePath ¶
func (*Info) CreateRepositoryDirIfNotExists ¶
oldname: CheckDialectDir
func (*Info) FindRepoFiles ¶
func (*Info) GenerateImplementFilePath ¶
oldname: CreateImplementFilePath
func (*Info) GenerateInterfaceFilePath ¶
oldname: CreateInterfaceFilePath
func (*Info) IsProvidesChanged ¶
func (*Info) TraverseFuncs ¶
func (*Info) TraverseRepoFiles ¶
func (*Info) TraverseRepos ¶
func (m *Info) TraverseRepos(fn func(intf *RepoInterface, rf *RepoFile) error) error
type Object ¶
func NewEmptyObject ¶
func NewEmptyObject(repo *RepoInterface) *Object
func (*Object) GetRepoInterface ¶
func (o *Object) GetRepoInterface() *RepoInterface
type RepoFile ¶
type RepoFile struct { File *ast.File `json:"-"` // Parsed bool Name string Path string Package string Imports map[string]string // key: 简写包名称 value: 包全称 ImportsReverseMap map[string]string // key: 包全称 value: 简写包名称 Repos []*RepoInterface SQLPackage string // database/sql RunTimePackage string // gitee.com/knowgo/gpa/rt DBUtilPackage string // gitee.com/knowgo/gpa/rt/dbutil // contains filtered or unexported fields }
func (*RepoFile) AddDBUtilPackage ¶
func (*RepoFile) AddRepo ¶
func (rf *RepoFile) AddRepo(repo *RepoInterface)
func (*RepoFile) AddRuntimePackage ¶
func (*RepoFile) AddSQLPackage ¶
func (*RepoFile) AddXTypePackage ¶
func (*RepoFile) FindImport ¶
type RepoInterface ¶
type RepoInterface struct { Name string Funcs []*Func RunTimePackage string // contains filtered or unexported fields }
func NewRepoInterface ¶
func NewRepoInterface(name string, logger logger.GpaLogger) *RepoInterface
func (*RepoInterface) AddFunction ¶
func (rf *RepoInterface) AddFunction(fn *Func)
func (*RepoInterface) Parse ¶
func (rf *RepoInterface) Parse(body *ast.InterfaceType, dialect string) error
Click to show internal directories.
Click to hide internal directories.