label

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2018 License: Apache-2.0 Imports: 6 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) Rel added in v0.13.0

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

func (Label) String

func (l Label) String() string

Jump to

Keyboard shortcuts

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