osrelease

package
v1.5.27 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 12 Imported by: 2

Documentation

Overview

Package osrelease provides an "os-release" distribution scanner.

Index

Constants

View Source
const (
	Path         = `etc/os-release`
	FallbackPath = `usr/lib/os-release`
)

Path and FallbackPath are the two documented locations for the os-release file. The latter should be consulted only if the former does not exist.

Variables

This section is empty.

Functions

func Parse added in v1.4.0

func Parse(ctx context.Context, r io.Reader) (map[string]string, error)

Parse splits the contents of "r" into key-value pairs as described in os-release(5).

See comments in the source for edge cases.

Types

type Scanner

type Scanner struct{}

Scanner implements a indexer.DistributionScanner that examines os-release files, as documented at https://www.freedesktop.org/software/systemd/man/os-release.html

func (*Scanner) Kind

func (*Scanner) Kind() string

Kind implements indexer.VersionedScanner.

func (*Scanner) Name

func (*Scanner) Name() string

Name implements indexer.VersionedScanner.

func (*Scanner) Scan

Scan reports any found os-release distribution information in the provided layer.

It's an expected outcome to return (nil, nil) when the os-release file is not present in the layer.

func (*Scanner) Version

func (*Scanner) Version() string

Version implements indexer.VersionedScanner.

Jump to

Keyboard shortcuts

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