label

package
v0.0.0-...-c02bc0f Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NoLabel = Label{}

NoLabel is the nil value of Label. It is not a valid label and may be returned when an error occurs.

Functions

func ImportPathToBazelRepoName

func ImportPathToBazelRepoName(importpath string) string

ImportPathToBazelRepoName converts a Go import path into a bazel repo name following the guidelines in http://bazel.io/docs/be/functions.html#workspace

Types

type Label

type Label struct {
	Repo, Pkg, Name string
	Relative        bool
}

A Label represents a label of a build target in Bazel.

func New

func New(repo, pkg, name string) Label

func Parse

func Parse(s string) (Label, error)

Parse reads a label from a string. See https://docs.bazel.build/versions/master/build-ref.html#lexi.

func (Label) Abs

func (l Label) Abs(repo, pkg string) Label

func (Label) Contains

func (l Label) Contains(other Label) bool

Contains returns whether other is contained by the package of l or a sub-package. Neither label may be relative.

func (Label) Equal

func (l Label) Equal(other Label) bool

func (Label) String

func (l Label) String() string

type Labeler

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

Labeler generates Bazel labels for rules, based on their locations within the repository.

func NewLabeler

func NewLabeler(c *config.Config) *Labeler

func (*Labeler) BinaryLabel

func (l *Labeler) BinaryLabel(rel string) Label

func (*Labeler) GoProtoLabel

func (l *Labeler) GoProtoLabel(rel, name string) Label

func (*Labeler) LibraryLabel

func (l *Labeler) LibraryLabel(rel string) Label

func (*Labeler) ProtoLabel

func (l *Labeler) ProtoLabel(rel, name string) Label

func (*Labeler) TestLabel

func (l *Labeler) TestLabel(rel string, isXTest bool) Label

Jump to

Keyboard shortcuts

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