version

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Info

type Info struct {
	Name         string
	Description  string
	Website      string
	GitVersion   string
	GitCommit    string
	GitTreeState string
	BuildDate    string
	BuiltBy      string
	// contains filtered or unexported fields
}

Info holds version information for the application. Fields are exported to match the caarlos0/go-version API.

func GetVersionInfo

func GetVersionInfo(opts ...Option) Info

GetVersionInfo creates a new Info struct pre-filled with build information from debug.BuildInfo, then applies the given options.

func (Info) String

func (i Info) String() string

String returns a formatted version string with ASCII art and build information.

type Option

type Option func(*Info)

Option is a function that configures an Info struct.

func WithASCIIName

func WithASCIIName(asciiName string) Option

WithASCIIName sets the ASCII art name.

func WithAppDetails

func WithAppDetails(name, description, website string) Option

WithAppDetails sets the application name, description, and website.

Jump to

Keyboard shortcuts

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