gotreload

package
v0.0.0-...-9b60cd8 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RegisteredSymbols = interp.Exports{}

Functions

func Register

func Register(pkgName, ident string, val reflect.Value)

Register records the mappings of exported symbol names to their values within the compiled executable.

func RegisterAll

func RegisterAll(symbols interp.Exports)

RegisterAll invokes Register once for each symbol provided in the symbols map.

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