Documentation
¶
Index ¶
- Constants
- type Version
- func (v *Version) BuildVersionLine(tmpl *string) (ret string)
- func (v *Version) SetApp(val string) *Version
- func (v *Version) SetAuthor(val string) *Version
- func (v *Version) SetBuildDate(val string) *Version
- func (v *Version) SetGitCommit(val string) *Version
- func (v *Version) SetVersion(val string) *Version
- func (v *Version) Title(tmpl *string) string
- type VersionOptionFunc
Constants ¶
View Source
const DefaultTitle = `{{.App}} {{.Version}} ({{.GitCommit}}; {{.Go}}/{{.Arch}}; by {{.Author}}; built at {{.BuildDate}})`
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Version ¶
type Version struct {
App string `json:"app"`
Author string `json:"author"`
Version string `json:"version"`
GitCommit string `json:"gitCommit"`
BuildDate string `json:"buildDate"`
Go string `json:"go"`
Arch string `json:"arch"`
}
func New ¶
func New(opts ...VersionOptionFunc) *Version
func (*Version) BuildVersionLine ¶
func (*Version) SetBuildDate ¶
func (*Version) SetGitCommit ¶
func (*Version) SetVersion ¶
type VersionOptionFunc ¶
type VersionOptionFunc func(*Version)
func WithBuildDate ¶
func WithBuildDate(val string) VersionOptionFunc
WithBuildDate sets the build tage
func WithGitCommit ¶
func WithGitCommit(val string) VersionOptionFunc
WithGitCommit sets the git commit
Click to show internal directories.
Click to hide internal directories.