distroinfo

package module
v0.61.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: BSD-3-Clause Imports: 8 Imported by: 0

README

distroinfo

The distro-info and distro-info-data debian/ubuntu package provides centralized lists of code-names and release history for the supported distributions (Currently: Debian and Ubuntu).

This package makes these information usable inside golang projects.


installation
$ go get github.com/fsrv-xyz/distro-info
usage

See the contents of the example directory for basic usage.


internals
updates

The distroinfo package is updated regularly. If you need to update the information on your own, you can use the generate script inside the data directory.

Requirements:

  • bash
  • curl
  • jq
  • python3
  • an internet connection ;)

The current version of the latest debian package is pinned in generate.go. Run go generate to update the information.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DistroFamilyNotFoundError  = errors.New("distro family not found")
	DistroVersionNotFoundError = errors.New("distro version not found")
)

Functions

func GetDistroVersions added in v0.58.1

func GetDistroVersions(distro string) ([]string, error)

func GetDistros added in v0.58.1

func GetDistros() []string

func GetSupportedDistroVersions added in v0.58.1

func GetSupportedDistroVersions(distro string) (map[string]SupportPeriod, error)

Types

type DistroInfo

type DistroInfo struct {
	Version  string     `json:"version"`
	Codename string     `json:"codename"`
	Series   string     `json:"series"`
	Created  *TimeStamp `json:"created"`
	Release  *TimeStamp `json:"release"`
	Eol      *TimeStamp `json:"eol"`
	EolLts   *TimeStamp `json:"eol-lts"`
	EolElts  *TimeStamp `json:"eol-elts"`
	EolEsm   *TimeStamp `json:"eol-esm"`
}

DistroInfo holds distro information

func GetDistroInfoByVersion

func GetDistroInfoByVersion(distro string, version string) (*DistroInfo, error)

type SupportPeriod added in v0.58.1

type SupportPeriod int
const (
	Unsupported SupportPeriod = iota
	Unreleased
	StandardSupport
	LongTermSupport
	ExtendedLongTermSupport
	ExpandedSecurityMaintenance
)

type TimeStamp added in v0.58.1

type TimeStamp struct {
	time.Time
}

func (*TimeStamp) UnmarshalJSON added in v0.58.1

func (t *TimeStamp) UnmarshalJSON(b []byte) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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