docker: github.com/docker/docker/pkg/parsers/kernel Index | Files

package kernel

import "github.com/docker/docker/pkg/parsers/kernel"

Package kernel provides helper function to get, parse and compare kernel versions for different platforms.

Package kernel provides helper function to get, parse and compare kernel versions for different platforms.

Index

Package Files

kernel.go kernel_unix.go uname_linux.go

func CheckKernelVersion Uses

func CheckKernelVersion(k, major, minor int) bool

CheckKernelVersion checks if current kernel is newer than (or equal to) the given version.

func CompareKernelVersion Uses

func CompareKernelVersion(a, b VersionInfo) int

CompareKernelVersion compares two kernel.VersionInfo structs. Returns -1 if a < b, 0 if a == b, 1 it a > b

type Utsname Uses

type Utsname unix.Utsname

Utsname represents the system name structure. It is passthrough for unix.Utsname in order to make it portable with other platforms where it is not available.

type VersionInfo Uses

type VersionInfo struct {
    Kernel int    // Version of the kernel (e.g. 4.1.2-generic -> 4)
    Major  int    // Major part of the kernel version (e.g. 4.1.2-generic -> 1)
    Minor  int    // Minor part of the kernel version (e.g. 4.1.2-generic -> 2)
    Flavor string // Flavor of the kernel version (e.g. 4.1.2-generic -> generic)
}

VersionInfo holds information about the kernel.

func GetKernelVersion Uses

func GetKernelVersion() (*VersionInfo, error)

GetKernelVersion gets the current kernel version.

func ParseRelease Uses

func ParseRelease(release string) (*VersionInfo, error)

ParseRelease parses a string and creates a VersionInfo based on it.

func (*VersionInfo) String Uses

func (k *VersionInfo) String() string

Package kernel imports 5 packages (graph) and is imported by 2687 packages. Updated 2020-07-22. Refresh now. Tools for package owners.