contemplate

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: MIT Imports: 6 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Packages []*PackageConfig `json:"packages" yaml:"packages"`
}

func (*Config) Package

func (c *Config) Package(path string) *PackageConfig

func (*Config) PackagePaths

func (c *Config) PackagePaths() []string

type Contemplate

type Contemplate struct {
	Packages map[string]*Package
	// contains filtered or unexported fields
}

func Load

func Load(cfg *Config) (*Contemplate, error)

func (*Contemplate) LookupAstIdentDefsByDeclType

func (s *Contemplate) LookupAstIdentDefsByDeclType(input types.TypeAndValue) []types.Object

func (*Contemplate) LookupExpr

func (s *Contemplate) LookupExpr(name string) ast.Expr

func (*Contemplate) LookupTypesByType

func (s *Contemplate) LookupTypesByType(obj types.Object) []types.Object

func (*Contemplate) Package

func (s *Contemplate) Package(path string) *Package

type Package

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

func NewPackage

func NewPackage(l *Contemplate, pkg *packages.Package) *Package

func (*Package) AddScopeTypes

func (s *Package) AddScopeTypes(names ...string)

func (*Package) Exprs

func (s *Package) Exprs() map[string]ast.Expr

func (*Package) FilterExprsByTypeExpr

func (s *Package) FilterExprsByTypeExpr(expr ast.Expr) []ast.Expr

func (*Package) LookupAstIdentDef

func (s *Package) LookupAstIdentDef(typeName string) *ast.Ident

func (*Package) LookupExpr

func (s *Package) LookupExpr(name string) ast.Expr

func (*Package) LookupScopeExpr

func (s *Package) LookupScopeExpr(name string) ast.Expr

func (*Package) LookupScopeType

func (s *Package) LookupScopeType(name string) types.Object

func (*Package) LookupType

func (s *Package) LookupType(name string) types.Object

func (*Package) Name

func (s *Package) Name() string

func (*Package) Path

func (s *Package) Path() string

func (*Package) Raw added in v0.1.3

func (s *Package) Raw() *packages.Package

func (*Package) ScopeTypes

func (s *Package) ScopeTypes() map[string]types.Object

func (*Package) Types

func (s *Package) Types() map[string]types.Object

type PackageConfig

type PackageConfig struct {
	Path  string   `json:"path" yaml:"path"`
	Types []string `json:"types" yaml:"types"`
}

Jump to

Keyboard shortcuts

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