pkg

package
v0.0.0-...-e6aa6c5 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package pkg defines the interface for loading Go packages.

It provides a pluggable means for systems like Bazel and Buck to inject an alternative package loading mechanism instead of go/packages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GoPackagesLoaderFactory

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

GoPackagesLoaderFactory builds a Loader that uses the go/packages to load package information.

func (*GoPackagesLoaderFactory) RegisterFlags

func (f *GoPackagesLoaderFactory) RegisterFlags(fset *flag.Set) Loader

RegisterFlags registers no new flags for GoPackagesLoaderFactory.

type Loader

type Loader interface {
	Load(fset *token.FileSet, importPath string) ([]*Package, error)
}

Loader loads information about a Go package from its import path.

type LoaderFactory

type LoaderFactory interface {
	// RegisterFlags builds a Loader and registers the flags
	// necessary for it with the given flag set.
	//
	// The returned Loader will not be used until the parser
	// has finished parsing its arguments.
	RegisterFlags(*flag.Set) Loader
}

LoaderFactory builds Loaders from command line flags.

type Package

type Package struct {
	// CompiledGoFiles is a list of absolute file paths of Go files.
	CompiledGoFiles []string
	// Syntax is a ASTs of files in CompiledGoFiles in the same order.
	Syntax []*ast.File
	// Types is type information about CompiledGoFiles.
	Types *types.Package
	// TypesInfo provides type information about ASTs.
	TypesInfo *types.Info
}

Package is a Go package that cff is going to generate code for.

Jump to

Keyboard shortcuts

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