Documentation ¶
Index ¶
- Constants
- Variables
- func GitCurrentBranch() (string, error)
- func GitLatestCommit() (string, error)
- func GoVersion() string
- func IsGitHashValue(str string) bool
- func IsValidBranch(str string) bool
- type Millet
- type Option
- type OptionFunc
- func WithAppName(appname string) OptionFunc
- func WithBuildTime(buildtime string) OptionFunc
- func WithDestOSARCH(arch string) OptionFunc
- func WithFromOSARCH(arch string) OptionFunc
- func WithGitBranch(branch string) OptionFunc
- func WithGitCommit(commit string) OptionFunc
- func WithGoVersion(goversion string) OptionFunc
- func WithVersion(version string) OptionFunc
Constants ¶
View Source
const (
GitHashValueLen = 40
)
Variables ¶
View Source
var ( ValidBranches = []string{"master", "release", "develop"} ErrInvalidBranch = fmt.Errorf("current git branch is invalid, millet only allow %q build binary", strings.Join(ValidBranches, ",")) ErrNotAGitRepository = fmt.Errorf("not a git repository") )
Functions ¶
func GitCurrentBranch ¶
GitCurrentBranch returns git commit of the latest.
func GitLatestCommit ¶
GitLatestCommit returns git commit of the latest.
func GoVersion ¶
func GoVersion() string
GoVersion returns current OS installed go version information.
func IsGitHashValue ¶
IsGitHashValue detect input string is Git commit hash value.
Types ¶
type Millet ¶
type Millet struct { AppName string Version string GoVersion string GitCommit string GitBranch string DestOSARCH string // Destination OS linux/amd64 FromOSARCH string // Building from darwin/amd64 BuildTime string }
Millet builder information structure.
func NewMilletWithConfig ¶
func (*Millet) JSONString ¶
type OptionFunc ¶
type OptionFunc func(millet *Millet)
func WithAppName ¶
func WithAppName(appname string) OptionFunc
func WithBuildTime ¶
func WithBuildTime(buildtime string) OptionFunc
func WithDestOSARCH ¶
func WithDestOSARCH(arch string) OptionFunc
func WithFromOSARCH ¶
func WithFromOSARCH(arch string) OptionFunc
func WithGitBranch ¶
func WithGitBranch(branch string) OptionFunc
func WithGitCommit ¶
func WithGitCommit(commit string) OptionFunc
func WithGoVersion ¶
func WithGoVersion(goversion string) OptionFunc
func WithVersion ¶
func WithVersion(version string) OptionFunc
Click to show internal directories.
Click to hide internal directories.