Documentation ¶
Index ¶
- func NewDummyAliasReferer() *dummyAliasReferer
- type AliasGetter
- type AliasReferer
- type GenType
- type PkgImport
- func (pi *PkgImport) Alias() string
- func (pi *PkgImport) Name() string
- func (pi *PkgImport) Path() string
- func (pi *PkgImport) PbPkg() string
- func (pi *PkgImport) SetAlias(alias string)
- func (pi *PkgImport) SetName(name string)
- func (pi *PkgImport) SetPath(path string)
- func (pi *PkgImport) SetPbPkg(pbPkg string)
- type PkgManager
- func (pm *PkgManager) AddImport(alias, pkgPath string, pbPkg string) *PkgImport
- func (pm *PkgManager) CreatePkgRefs() *PkgRefs
- func (pm *PkgManager) GetPkgsForAlias() map[string]*PkgImport
- func (pm *PkgManager) ParseTmplCall(callStmt string) (pkgPath, relPkgPath, callName string)
- func (pm *PkgManager) PkgByAlias(alias string) *PkgImport
- func (pm *PkgManager) PkgByPath(pkgPath string) *PkgImport
- type PkgRefs
- func (pr *PkgRefs) DumpRequires(requires map[string]bool)
- func (pr *PkgRefs) GenerateImports(output io.Writer, genType GenType)
- func (pr *PkgRefs) GenerateRequires(output io.Writer)
- func (pr *PkgRefs) ParseTmplCall(callStmt string) (pkgPath, relPkgPath, callName string)
- func (pr *PkgRefs) RefByAlias(alias string, forInterface bool) AliasGetter
- func (pr *PkgRefs) RefByPath(pkgPath string, forInterface bool) AliasGetter
- func (pr *PkgRefs) RefClosureRequire(require string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDummyAliasReferer ¶
func NewDummyAliasReferer() *dummyAliasReferer
Types ¶
type AliasGetter ¶
type AliasGetter interface {
Alias() string
}
type AliasReferer ¶
type AliasReferer interface { RefByAlias(string, bool) AliasGetter RefByPath(string, bool) AliasGetter RefClosureRequire(string) }
type PkgManager ¶
type PkgManager struct {
// contains filtered or unexported fields
}
PackageManager maintains all package imports in a template file.
func New ¶
func New(tmplPkg, outputPkgPrefix string) *PkgManager
func (*PkgManager) AddImport ¶
func (pm *PkgManager) AddImport(alias, pkgPath string, pbPkg string) *PkgImport
func (*PkgManager) CreatePkgRefs ¶
func (pm *PkgManager) CreatePkgRefs() *PkgRefs
func (*PkgManager) GetPkgsForAlias ¶
func (pm *PkgManager) GetPkgsForAlias() map[string]*PkgImport
func (*PkgManager) ParseTmplCall ¶
func (pm *PkgManager) ParseTmplCall(callStmt string) (pkgPath, relPkgPath, callName string)
func (*PkgManager) PkgByAlias ¶
func (pm *PkgManager) PkgByAlias(alias string) *PkgImport
func (*PkgManager) PkgByPath ¶
func (pm *PkgManager) PkgByPath(pkgPath string) *PkgImport
type PkgRefs ¶
type PkgRefs struct {
// contains filtered or unexported fields
}
PkgRefs maintains package imports for a specific template.
func (*PkgRefs) DumpRequires ¶
func (*PkgRefs) GenerateImports ¶
func (*PkgRefs) GenerateRequires ¶
func (*PkgRefs) ParseTmplCall ¶
func (*PkgRefs) RefByAlias ¶
func (pr *PkgRefs) RefByAlias(alias string, forInterface bool) AliasGetter
func (*PkgRefs) RefByPath ¶
func (pr *PkgRefs) RefByPath(pkgPath string, forInterface bool) AliasGetter
func (*PkgRefs) RefClosureRequire ¶
Click to show internal directories.
Click to hide internal directories.