builder

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Version 版本 由外部ldflags指定
	Version string
	// GitCommit git提交版本(短) 由外部ldflags指定
	GitCommit string
	// GitFullCommit git提交版本(完整) 由外部ldflags指定
	GitFullCommit string
	// GitTag git的tag 由外部ldflags指定
	GitTag string
	// BuildDate 编译日期 由外部ldflags指定
	BuildDate string
)

populated by ldflags

Functions

func Fprintln

func Fprintln(w io.Writer, opts ...Option)

func Println

func Println(opts ...Option)

Println 打印版本信息以及一些布署信息至os.Stdout

Types

type Information

type Information struct {
	Version       string
	GitCommit     string
	GitFullCommit string
	GitTag        string
	BuildDate     string
	GoVersion     string
	GOOS          string
	GOARCH        string
	GoMaxProcs    int
	NumCPU        int
	Deploy        string
	Metadata      map[string]string
}

Information 版本信息以及一些布署信息

type Option

type Option func(info *Information)

func WithDeploy

func WithDeploy(deploy string) Option

WithDeploy 设置布署信息

func WithMetadata

func WithMetadata(m map[string]string) Option

WithMetadata 设置其它基本信息

Jump to

Keyboard shortcuts

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