millet

package module
v1.0.0 Latest Latest
Warning

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

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

README

millet

Installation

Package
go get -u github.com/go-millet/millet
Command line tools
go get -u github.com/go-millet/millet/cmd/milletctl

Usage


Documentation

Index

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

func GitCurrentBranch() (string, error)

GitCurrentBranch returns git commit of the latest.

func GitLatestCommit

func GitLatestCommit() (string, error)

GitLatestCommit returns git commit of the latest.

func GoVersion

func GoVersion() string

GoVersion returns current OS installed go version information.

func IsGitHashValue

func IsGitHashValue(str string) bool

IsGitHashValue detect input string is Git commit hash value.

func IsValidBranch

func IsValidBranch(str string) bool

IsValidBranch is valid branch.

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 NewMillet

func NewMillet(options ...Option) *Millet

func NewMilletWithConfig

func NewMilletWithConfig(c *exchange.MilletConfig, arch osarch.OSARCH) (*Millet, error)

func (*Millet) JSONString

func (millet *Millet) JSONString() string

func (*Millet) RawString

func (millet *Millet) RawString() string

type Option

type Option interface {
	// contains filtered or unexported methods
}

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

Jump to

Keyboard shortcuts

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