kubernetesk8s.io/kubernetes/cmd/libs/go2idl/parser Index | Files

package parser

import "k8s.io/kubernetes/cmd/libs/go2idl/parser"

Package parser provides code to parse go files, type-check them, extract the types.

Index

Types

type Builder

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

Builder lets you add all the go files in all the packages that you care about, then constructs the type source data.

func New

func New() *Builder

New constructs a new builder.

func (*Builder) AddBuildTags

func (b *Builder) AddBuildTags(tags ...string)

AddBuildTags adds the specified build tags to the parse context.

func (*Builder) AddDir

func (b *Builder) AddDir(dir string) error

AddDir adds an entire directory, scanning it for go files. 'dir' should have a single go package in it. GOPATH, GOROOT, and the location of your go binary (`which go`) will all be searched if dir doesn't literally resolve.

func (*Builder) AddFile

func (b *Builder) AddFile(name string, src []byte) error

AddFile adds a file to the set. The name must be of the form canonical/pkg/path/file.go.

func (*Builder) FindTypes

func (b *Builder) FindTypes() (types.Universe, error)

FindTypes finalizes the package imports, and searches through all the packages for types.

Source Files

doc.go parse.go

Version
v1.2.0-alpha.5
Published
Dec 15, 2015
Platform
windows/amd64
Imports
11 packages
Last checked
1 hour ago

Tools for package owners.