pi

package
v0.28.3 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2025 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrBuildInfoIsNotAvailable      = "build info is not available"
	ErrDependencyInfoIsNotAvailable = "dependency info is not available"
	ErrProgramNameIsEmpty           = "program name is empty"
	ErrDependencyNameIsEmpty        = "dependency name is empty"
	ErrProgramVersionIsEmpty        = "program version is empty"
	ErrDependencyVersionIsEmpty     = "dependency version is empty"
)
View Source
const (
	NameUnknown    = "???"
	VersionUnknown = "v??"
)
View Source
const (
	ErrUnsupportedVCS        = "unsupported VCS: %v"
	ErrGitHubRepositoryOwner = "GitHub repository owner is not found"
)
View Source
const (
	DependenciesTextPrefix = "Dependencies: "
)
View Source
const (
	VcsGitHub = "github.com"
)
View Source
const VersionMark = 'v'

Variables

This section is empty.

Functions

This section is empty.

Types

type Dependency

type Dependency struct {
	// contains filtered or unexported fields
}

Dependency is information about program's dependency.

func NewDependency

func NewDependency(m *debug.Module) (dep *Dependency, err error)

type ProgramInfo

type ProgramInfo struct {
	// contains filtered or unexported fields
}

ProgramInfo is information about program and its dependencies.

func NewProgramInfo

func NewProgramInfo() (info *ProgramInfo, err error)

NewProgramInfo provides convenient access to program's name, program's version and information about dependencies. Program's version is taken from both runtime and VCS. Dependencies are taken from runtime.

func (*ProgramInfo) DependenciesList

func (pi *ProgramInfo) DependenciesList() (list []*Dependency)

DependenciesList returns a list of dependencies provided by runtime.

func (*ProgramInfo) DependenciesText

func (pi *ProgramInfo) DependenciesText() (txt string)

DependenciesText returns a textual list of dependencies provided by runtime.

func (*ProgramInfo) IsUpdateAvailable

func (pi *ProgramInfo) IsUpdateAvailable() bool

IsUpdateAvailable tells if there is an updated version of the program available. This information is provided by VCS.

func (*ProgramInfo) LatestVersion

func (pi *ProgramInfo) LatestVersion() *ver.Version

LatestVersion return latest version provided by VCS.

func (*ProgramInfo) ProgramName

func (pi *ProgramInfo) ProgramName() (name string)

ProgramName returns program's name provided by runtime.

func (*ProgramInfo) ProgramVcsVersion

func (pi *ProgramInfo) ProgramVcsVersion() *ver.Version

ProgramVcsVersion returns version string provided by VCS.

func (*ProgramInfo) ProgramVersionNumber

func (pi *ProgramInfo) ProgramVersionNumber() (versionNumber string)

ProgramVersionNumber returns version string provided by runtime with prefix trimmed.

func (*ProgramInfo) ProgramVersionString

func (pi *ProgramInfo) ProgramVersionString() (version string)

ProgramVersionString returns version string provided by runtime.

Jump to

Keyboard shortcuts

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