loader

package
v0.0.0-...-a4bf063 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2019 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

type Engine struct {
	Log log.Logger
	// contains filtered or unexported fields
}

Engine is a Go code loader

func NewEngine

func NewEngine(l log.Logger) *Engine

NewEngine creates a new loader

func (*Engine) Close

func (le *Engine) Close() error

Close stops the loader engine processing

type File

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

File is an AST file and any errors that types.Config.Check discovers

type FileError

type FileError struct {
	token.Position
	Message string
	Warning bool
}

FileError is a translation of the types.Error struct

type Loader

type Loader struct {
	StartDir string

	Tags []string

	Log log.Logger

	PackageHashSet map[collections.Hash]bool
	// contains filtered or unexported fields
}

Loader is the workspace-specific configuration and context for building and type-checking

func NewLoader

func NewLoader(logger log.Logger, options ...Option) *Loader

NewLoader creates a new Loader

func (*Loader) Close

func (l *Loader) Close() error

func (*Loader) FindImportPath

func (l *Loader) FindImportPath(p *Package, importPath string) (string, error)

FindImportPath is used by the loader engine locate the path to a packge imported by the specified package

func (*Loader) FindPackage

func (l *Loader) FindPackage(absPath string) (*Package, error)

FindPackage will locate the package at the provided path

func (*Loader) HandleTypeCheckerError

func (l *Loader) HandleTypeCheckerError(e error)

HandleTypeCheckerError is invoked from the types.Checker when it encounters errors

func (*Loader) LoadDirectory

func (l *Loader) LoadDirectory(startDir string) error

LoadDirectory adds the contents of a directory to the Loader

func (*Loader) Signal

func (l *Loader) Signal()

func (*Loader) String

func (l *Loader) String() string

String is the implementation of fmt.Stringer

func (*Loader) Wait

func (l *Loader) Wait()

Wait blocks until all packages have been loaded

type Option

type Option func(l *Loader)

Option provides a hook for NewLoader to set or modify the new loader's build.Context

type Package

type Package struct {
	AbsPath string

	Fset *token.FileSet
	// contains filtered or unexported fields
}

Package contains the os/arch specific package AST

func NewPackage

func NewPackage(l *Loader, absPath string) *Package

NewPackage returns a new instance of Package

func (*Package) FindSource

func (p *Package) FindSource(structName string) (string, *types.Struct, error)

func (*Package) Hash

func (p *Package) Hash() collections.Hash

Hash returns the hash for this package

func (*Package) Name

func (p *Package) Name() string

func (*Package) String

func (p *Package) String() string

func (*Package) WaitUntilReady

func (p *Package) WaitUntilReady(loadState loadState)

WaitUntilReady blocks until this package has loaded sufficiently for the requested load state.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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