packages

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package packages defines types for interpreting qualified names.

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultPackage has an empty package name.
	DefaultPackage = NewPackage("")
)

Functions

func ToQualifiedName added in v0.5.0

func ToQualifiedName(e *exprpb.Expr) (string, bool)

ToQualifiedName converts an expression AST into a qualified name if possible, with a boolean 'found' value that indicates if the conversion is successful.

Types

type Packager

type Packager interface {
	// Package returns the qualified package name of the packager.
	//
	// The package path may be a namespace, package, or type.
	Package() string

	// ResolveCandidateNames returns the list of possible qualified names
	// visible within the module in name resolution order.
	//
	// Name candidates are returned in order of most to least qualified in
	// order to ensure that shadowing names are encountered first.
	ResolveCandidateNames(name string) []string
}

Packager helps interpret qualified names.

func NewPackage

func NewPackage(pkg string) Packager

NewPackage creates a new Packager with the given qualified package name.

Jump to

Keyboard shortcuts

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