bingo

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvBinVarsName = "variables.env"
)
View Source
const (
	// FakeRootModFileName is a name for fake go module that we have to maintain, until https://github.com/bwplotka/bingo/issues/20 is fixed.
	FakeRootModFileName = "go.mod"
)
View Source
const (
	MakefileBinVarsName = "Variables.mk"
)

Variables

View Source
var NoMeta = errors.New("bingo: Go Module without bingo's metadata")

Functions

func EnsureModMeta

func EnsureModMeta(modFile string, pkg string) (err error)

EnsureModMeta comment on given module file to make sure users knows it's autogenerated. It also ensures that sub package path is recorded, which is required for package-level versioning.

func GenHelpers added in v0.2.0

func GenHelpers(relModDir, version string, pkgs []MainPackage) error

GenHelpers generates helpers to allows reliable binaries use. Regenerate if needed. It is expected to have at least one mod file.

func ModDirectPackage

func ModDirectPackage(modFile string, r io.Reader) (pkg string, version string, err error)

ModDirectPackage returns buildable package we encoded in the bingo controlled go module. We encode it as single direct module with end of line comment containing relative package path if any. If r is nil, modFile will be read. If given file is Go Module, but without bingo metadata bingo.NoMeta error is returned.

func NameFromModFile

func NameFromModFile(modFile string) (name string, oneOfMany bool)

NameFromModFile returns binary name from module file path.

func RemoveHelpers added in v0.2.0

func RemoveHelpers(modDir string) error

RemoveHelpers deletes helpers from mod directory.

Types

type MainPackage added in v0.2.2

type MainPackage struct {
	Name        string
	PackagePath string
	EnvVarName  string
	Versions    []MainPackageVersion
}

func ListPinnedMainPackages added in v0.2.2

func ListPinnedMainPackages(logger *log.Logger, modDir string, remMalformed bool) (pkgs []MainPackage, _ error)

ListPinnedMainPackages lists all bingo pinned binaries (Go main packages).

type MainPackageVersion added in v0.2.2

type MainPackageVersion struct {
	Version string
	ModFile string
}

Jump to

Keyboard shortcuts

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