Documentation
¶
Index ¶
- Constants
- Variables
- func EnsureModMeta(modFile string, pkg string) (err error)
- func GenHelpers(relModDir, version string, pkgs []MainPackage) error
- func ModDirectPackage(modFile string, r io.Reader) (pkg string, version string, err error)
- func NameFromModFile(modFile string) (name string, oneOfMany bool)
- func RemoveHelpers(modDir string) error
- type MainPackage
- type MainPackageVersion
Constants ¶
const (
EnvBinVarsName = "variables.env"
)
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"
)
const (
MakefileBinVarsName = "Variables.mk"
)
Variables ¶
var NoMeta = errors.New("bingo: Go Module without bingo's metadata")
Functions ¶
func EnsureModMeta ¶
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 ¶
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 ¶
NameFromModFile returns binary name from module file path.
func RemoveHelpers ¶ added in v0.2.0
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).