pkgmgr

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 24, 2018 License: BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Index

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 GenType

type GenType int
const (
	GenInterfaceImports GenType = iota
	GenImplImports
)

type PkgImport

type PkgImport struct {
	// contains filtered or unexported fields
}

func (*PkgImport) Alias

func (pi *PkgImport) Alias() string

func (*PkgImport) Name

func (pi *PkgImport) Name() string

func (*PkgImport) Path

func (pi *PkgImport) Path() string

func (*PkgImport) PbPkg

func (pi *PkgImport) PbPkg() string

func (*PkgImport) SetAlias

func (pi *PkgImport) SetAlias(alias string)

func (*PkgImport) SetName

func (pi *PkgImport) SetName(name string)

func (*PkgImport) SetPath

func (pi *PkgImport) SetPath(path string)

func (*PkgImport) SetPbPkg

func (pi *PkgImport) SetPbPkg(pbPkg 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 (pr *PkgRefs) DumpRequires(requires map[string]bool)

func (*PkgRefs) GenerateImports

func (pr *PkgRefs) GenerateImports(output io.Writer, genType GenType)

func (*PkgRefs) GenerateRequires

func (pr *PkgRefs) GenerateRequires(output io.Writer)

func (*PkgRefs) ParseTmplCall

func (pr *PkgRefs) ParseTmplCall(callStmt string) (pkgPath, relPkgPath, callName string)

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

func (pr *PkgRefs) RefClosureRequire(require string)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL