Documentation ¶
Index ¶
- Constants
- func AstParseDir(dir string) (files []*ast.File, err error)
- func BoilerplatePath() string
- func CheckTag(tag string, comments []string, require ...string) bool
- func CurrentPackage() string
- func Exist(list []string, want string) bool
- func FindTypeNames(files []*ast.File) (m map[string]string)
- func GenName(prefix, suffix string) func(name string) string
- func GetTagBoolStatus(tag string, comments []string) (set bool, enabled bool)
- func GetTagValueStatus(tag string, comments []string) (bool, string)
- func GetTagValues(tag string, comments []string) []string
- func GetTagValuesStatus(tag string, comments []string) (bool, []string)
- func IsLower(s string) bool
- func IsReference(t *types.Type) bool
- func ReContextOrder(c *generator.Context, canonicalOrderName string)
- func UnderlyingType(t *types.Type) *types.Type
- func Vendorless(p string) string
- type MethodGenerate
- type MethodSet
- type PackageType
- type PackageTypes
Constants ¶
View Source
const ( Package = "package" True = "true" False = "false" )
Variables ¶
This section is empty.
Functions ¶
func BoilerplatePath ¶
func BoilerplatePath() string
BoilerplatePath returns the path to the boilerplate file in code-generator, or "" if the default boilerplate.go.txt file cannot be located.
func CurrentPackage ¶
func CurrentPackage() string
CurrentPackage returns the go package of the current directory, or "" if it cannot be derived from the GOPATH.
func GetTagBoolStatus ¶
func GetTagValues ¶
func IsReference ¶
IsReference return true for pointer, maps, slices and aliases of those.
func ReContextOrder ¶
ReContextOrder 重新进行排除
func Vendorless ¶
Vendorless trims vendor prefix from a package path to make it canonical
Types ¶
type MethodGenerate ¶
type MethodGenerate struct {
// contains filtered or unexported fields
}
func NewMethodGenerate ¶
func NewMethodGenerate(fn func(name string) string, handler ...func(string) string) MethodGenerate
func (*MethodGenerate) AddExistName ¶
func (m *MethodGenerate) AddExistName(name string) (bool, int)
func (*MethodGenerate) AddExistNames ¶
func (m *MethodGenerate) AddExistNames(name ...string) *MethodGenerate
func (*MethodGenerate) ExistName ¶
func (m *MethodGenerate) ExistName(name string) bool
func (*MethodGenerate) GenName ¶
func (m *MethodGenerate) GenName(name string) string
type PackageType ¶
type PackageType struct { Name string // pkg name Types map[string]string // key: type's name value: type }
func (PackageType) GetType ¶
func (p PackageType) GetType(name string) string
func (PackageType) IsExternalType ¶
func (p PackageType) IsExternalType(name string) bool
type PackageTypes ¶
type PackageTypes []*PackageType
func NewPackageTypes ¶
func NewPackageTypes(build *parser.Builder) (ret PackageTypes)
func (PackageTypes) Find ¶
func (list PackageTypes) Find(pkg string) *PackageType
func (PackageTypes) IsExternalType ¶
func (list PackageTypes) IsExternalType(pkg, name string) bool
Source Files ¶
Click to show internal directories.
Click to hide internal directories.