astutil

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Decl

type Decl struct {
	Meta  Meta
	Ident Ident
}

Decl example: var Container = di.New("container")

func ContainerDeclFromNode

func ContainerDeclFromNode(node ast.Node, meta Meta, diPkgIdent Ident) []Decl

type Ident

type Ident string

func (Ident) Exported

func (i Ident) Exported() bool

func (Ident) String

func (i Ident) String() string

type Meta

type Meta struct {
	// Pkg is the package name where the object is defined
	Pkg string
	// Filepath where the object is defined
	Filepath string
	// Module in which the object is defined
	Module string
	// Pos where the token is defined
	Pos token.Pos
}

func (*Meta) PkgPath added in v0.0.3

func (m *Meta) PkgPath() string

type ObjRef

type ObjRef struct {
	// Ident of the object we are referencing
	Ident Ident
	// PkgIdent (optional) is the identity referencing a PkgImport
	PkgIdent *Ident
}

type PkgImport

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

func NewPkgImport

func NewPkgImport(spec *ast.ImportSpec) PkgImport

func PkgImportFromNode

func PkgImportFromNode(node ast.Node) []PkgImport

func (*PkgImport) Ident

func (d *PkgImport) Ident() Ident

Ident returns the user specified ident for the package or the package's name if no user specified ident was found

func (*PkgImport) Pkg

func (d *PkgImport) Pkg() string

Pkg returns the package path, e.g.: "github.com/alexandremahdhaoui/di"

type Usage

type Usage struct {
	Meta   Meta
	ObjRef ObjRef
}

type ValuefuncDecl

type ValuefuncDecl struct {
	Decl Decl

	TypeRef      ObjRef
	ContainerRef ObjRef
}

func ValuefuncDeclFromNode

func ValuefuncDeclFromNode(node ast.Node, meta Meta, diPkgIdent Ident) []ValuefuncDecl

Jump to

Keyboard shortcuts

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