gotool

package
v0.0.0-...-89480e5 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2018 License: BSD-2-Clause Imports: 12 Imported by: 0

Documentation

Overview

Package gotool manages access to the Go tool for building packages, plugins, and export data for feeding the go/types package.

It maintains a process-wide temporary directory that is used as a GOPATH for building ephemeral packages as part of executing the Neugram interpreter. It is process-wide because plugins are necessarily so, and so maintaining any finer-grained GOPATHs just lead to confusion and bugs.

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type Manager

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

Manager is a process-global manager of an ephemeral GOPATH used to generate plugins.

Completely independent *Program objects co-ordinate the plugins they generate to avoid multiple attempts at loading the same plugin.

func (*Manager) Cleanup

func (m *Manager) Cleanup()

func (*Manager) Create

func (m *Manager) Create(name string, contents []byte) (*plugin.Plugin, error)

Create creates and loads a single-file plugin outside of the process-temporary plugin GOPATH.

func (*Manager) Dir

func (m *Manager) Dir(pkgPath string) (adjPkgPath, dir string, err error)

func (*Manager) ImportGo

func (m *Manager) ImportGo(path string) (*gotypes.Package, error)

func (*Manager) Open

func (m *Manager) Open(mainPkgPath string) (*plugin.Plugin, error)

Jump to

Keyboard shortcuts

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