util

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Version is the bff version
	Version = "undefined"
	// GitSha is the gitsha used to build this version
	GitSha = "undefined"
	// Release is true if this is a release
	Release = "false"
	// Dirty if git is dirty
	Dirty = "true"
)

Functions

func GetGitAuthor added in v0.1.3

func GetGitAuthor() (string, string, error)

GetGitAuthor returns the author name and email

func GetLatestParentCommit added in v0.1.4

func GetLatestParentCommit(commit *object.Commit) (*object.Commit, error)

GetLatestParentCommit returns the most recent parent commit

func LatestTagCommitHash added in v0.1.4

func LatestTagCommitHash(repo GitRepoIface, branchRef string) (*string, *plumbing.Hash, error)

LatestTagCommitHash will get the latest tag and commit hash for a repo

func VerifyDefaultBranch added in v0.2.0

func VerifyDefaultBranch(repo GitRepoIface, defaultBranchRef string) (*object.Commit, error)

VerifyDefaultBranch returns the default branch's commit, according to HEAD

func VersionCacheKey

func VersionCacheKey() string

VersionCacheKey returns a key to version the cache

func VersionString

func VersionString() (string, error)

VersionString returns the version string

Types

type GitRepoIface added in v0.2.0

type GitRepoIface interface {
	CommitObject(h plumbing.Hash) (*object.Commit, error)
	Head() (*plumbing.Reference, error)
	Log(o *git.LogOptions) (object.CommitIter, error)
	Reference(name plumbing.ReferenceName, resolved bool) (*plumbing.Reference, error)
	Tags() (storer.ReferenceIter, error)
}

Jump to

Keyboard shortcuts

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