gotreload

package
v0.0.0-...-23b874d Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2021 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Info

type Info struct {
	Registrations []byte
}

type Rewriter

type Rewriter struct {
	Config packages.Config
	Pkgs   []*packages.Package
	// Keys are PkgPath & setter name.  We use PkgPath as the key instead of
	// a *packages.Package because we need to be able to find this across
	// different instances of Rewriter, where pointer values will be
	// different, but package import paths, which are just strings, will be
	// the same.
	NewFunc map[string]map[string]*ast.FuncLit

	// Per-package supplemental information.  Used only in initial rewrite.
	Info map[*packages.Package]*Info
}

func (*Rewriter) FuncDef

func (r *Rewriter) FuncDef(pkgPath, setter string) (string, map[string]string, error)

func (*Rewriter) Load

func (r *Rewriter) Load(paths ...string) error

func (*Rewriter) LookupFile

func (r *Rewriter) LookupFile(targetFileName string) (*ast.File, *token.FileSet, error)

func (*Rewriter) Print

func (r *Rewriter) Print(root string) error

Print prints the rewritten files to a tree rooted in the given path.

func (*Rewriter) Rewrite

func (r *Rewriter) Rewrite(addPackage bool) error

Rewrite rewrites the ASTs in r.Pkgs in place. addPackage==true is used in reload mode, to add package prefixes to all mentioned variables.

Jump to

Keyboard shortcuts

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