starlarkutil

package
v0.0.0-...-2898a4c Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExpectIdent

func ExpectIdent(x syntax.Expr) (string, error)

ExpectIdent returns an identifier string or an error if this Expr is not an identifier.

func ExpectLiteralString

func ExpectLiteralString(x syntax.Expr) (string, error)

ExpectLiteralString returns the string represented by this Expr or an error if the Expr is not a literal string.

func ExpectSingletonStringList

func ExpectSingletonStringList(x syntax.Expr) (string, error)

ExpectSingletonStringList returns the string in this list or an error if this Expr is not a string list of length 1.

func ExpectTupleOfStrings

func ExpectTupleOfStrings(x syntax.Expr, length int) ([]string, error)

ExpectTupleOfStrings returns the strings in the tuple represented by this Expr or an error if this is not a string tuple of the correct length.

func GetFunctionFromCall

func GetFunctionFromCall(call *syntax.CallExpr) string

GetFunctionFromCall returns the name of the function called for the given call expression, or the empty string if the function being called is not a normal identifier.

func ListArtifactsInDepsBzl

func ListArtifactsInDepsBzl(depsBzl string) (map[string]DownloadableArtifact, error)

ListArtifactsInDepsBzl parses the DEPS.bzl file and returns a map of repo name -> DownloadableArtifact capturing what's in that repo.

Types

type DownloadableArtifact

type DownloadableArtifact struct {
	URL    string
	Sha256 string
}

DownloadableArtifact represents a single URL/SHA256 pair.

func GetArtifactFromGoRepository

func GetArtifactFromGoRepository(call *syntax.CallExpr) (DownloadableArtifact, error)

GetArtifactFromGoRepository returns the DownloadableArtifact pointed to by the given go_repository.

func GetArtifactFromHTTPArchive

func GetArtifactFromHTTPArchive(call *syntax.CallExpr) (DownloadableArtifact, error)

GetArtifactFromHTTPArchive returns the DownloadableArtifact for a given http_archive() call.

Jump to

Keyboard shortcuts

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