Documentation ¶
Index ¶
- func ParseSQL(comment, dialect string) (sql, orderBy string)
- type Func
- func (f *Func) AddDBUtilPackage() string
- func (f *Func) AddInterfacePackage() (string, 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) AddInterfacePackage() (string, string)
- func (rf *RepoFile) AddLogoPackage() 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 ¶
Types ¶
type Func ¶
func NewFunc ¶
func NewFunc(repo *RepoInterface) *Func
func NewFuncWithObject ¶
func (*Func) AddDBUtilPackage ¶
func (*Func) AddInterfacePackage ¶ added in v0.1.6
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 ¶
type Object struct { *objs.Object SQL string OrderBy string // 用于 FindXBy 模式的查询排序 // contains filtered or unexported fields }
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 InterfacePackage string // 接口定义包 SQLPackage string // database/sql LogoPackage string // gitee.com/knowgo/logo 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) AddInterfacePackage ¶ added in v0.1.6
func (*RepoFile) AddLogoPackage ¶ added in v0.2.0
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 LogoPackage string // contains filtered or unexported fields }
func NewRepoInterface ¶
func NewRepoInterface(name string, logger logo.Logger) *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.