Documentation ¶
Index ¶
- Variables
- type Host
- func (k *Host) HaveMmapableMaps() bool
- func (k *Host) HaveRingBuffers() bool
- func (k *Host) IsAmazonLinuxKernel() bool
- func (k *Host) IsCOSKernel() bool
- func (k *Host) IsDebianKernel() bool
- func (k *Host) IsInRangeCloseOpen(begin Version, end Version) bool
- func (k *Host) IsOracleUEKKernel() bool
- func (k *Host) IsRH7Kernel() bool
- func (k *Host) IsRH8Kernel() bool
- func (k *Host) IsSLESKernel() bool
- func (k *Host) IsSuse12Kernel() bool
- func (k *Host) IsSuse15Kernel() bool
- func (k *Host) IsSuseKernel() bool
- func (k *Host) IsUbuntuKernel() bool
- func (k *Host) String() string
- func (k *Host) UbuntuKernelVersion() *UbuntuKernelVersion
- type UbuntuKernelVersion
- type Version
Constants ¶
This section is empty.
Variables ¶
var ( // Kernel4_9 is the KernelVersion representation of kernel version 4.9 Kernel4_9 = VersionCode(4, 9, 0) //nolint:deadcode,unused // Kernel4_10 is the KernelVersion representation of kernel version 4.10 Kernel4_10 = VersionCode(4, 10, 0) //nolint:deadcode,unused // Kernel4_12 is the KernelVersion representation of kernel version 4.12 Kernel4_12 = VersionCode(4, 12, 0) //nolint:deadcode,unused // Kernel4_13 is the KernelVersion representation of kernel version 4.13 Kernel4_13 = VersionCode(4, 13, 0) //nolint:deadcode,unused // Kernel4_14 is the KernelVersion representation of kernel version 4.14 Kernel4_14 = VersionCode(4, 14, 0) //nolint:deadcode,unused // Kernel4_15 is the KernelVersion representation of kernel version 4.15 Kernel4_15 = VersionCode(4, 15, 0) //nolint:deadcode,unused // Kernel4_16 is the KernelVersion representation of kernel version 4.16 Kernel4_16 = VersionCode(4, 16, 0) //nolint:deadcode,unused // Kernel4_18 is the KernelVersion representation of kernel version 4.18 Kernel4_18 = VersionCode(4, 18, 0) //nolint:deadcode,unused // Kernel4_19 is the KernelVersion representation of kernel version 4.19 Kernel4_19 = VersionCode(4, 19, 0) //nolint:deadcode,unused // Kernel4_20 is the KernelVersion representation of kernel version 4.20 Kernel4_20 = VersionCode(4, 20, 0) //nolint:deadcode,unused // Kernel5_0 is the KernelVersion representation of kernel version 5.0 Kernel5_0 = VersionCode(5, 0, 0) //nolint:deadcode,unused // Kernel5_1 is the KernelVersion representation of kernel version 5.1 Kernel5_1 = VersionCode(5, 1, 0) //nolint:deadcode,unused // Kernel5_2 is the KernelVersion representation of kernel version 5.2 Kernel5_2 = VersionCode(5, 2, 0) //nolint:deadcode,unused // Kernel5_3 is the KernelVersion representation of kernel version 5.3 Kernel5_3 = VersionCode(5, 3, 0) //nolint:deadcode,unused // Kernel5_4 is the KernelVersion representation of kernel version 5.4 Kernel5_4 = VersionCode(5, 4, 0) //nolint:deadcode,unused // Kernel5_5 is the KernelVersion representation of kernel version 5.5 Kernel5_5 = VersionCode(5, 5, 0) //nolint:deadcode,unused // Kernel5_6 is the KernelVersion representation of kernel version 5.6 Kernel5_6 = VersionCode(5, 6, 0) //nolint:deadcode,unused // Kernel5_7 is the KernelVersion representation of kernel version 5.7 Kernel5_7 = VersionCode(5, 7, 0) //nolint:deadcode,unused // Kernel5_8 is the KernelVersion representation of kernel version 5.8 Kernel5_8 = VersionCode(5, 8, 0) //nolint:deadcode,unused // Kernel5_9 is the KernelVersion representation of kernel version 5.9 Kernel5_9 = VersionCode(5, 9, 0) //nolint:deadcode,unused // Kernel5_10 is the KernelVersion representation of kernel version 5.10 Kernel5_10 = VersionCode(5, 10, 0) //nolint:deadcode,unused // Kernel5_11 is the KernelVersion representation of kernel version 5.11 Kernel5_11 = VersionCode(5, 11, 0) //nolint:deadcode,unused // Kernel5_12 is the KernelVersion representation of kernel version 5.12 Kernel5_12 = VersionCode(5, 12, 0) //nolint:deadcode,unused // Kernel5_13 is the KernelVersion representation of kernel version 5.13 Kernel5_13 = VersionCode(5, 13, 0) //nolint:deadcode,unused // Kernel5_14 is the KernelVersion representation of kernel version 5.14 Kernel5_14 = VersionCode(5, 14, 0) //nolint:deadcode,unused // Kernel5_15 is the KernelVersion representation of kernel version 5.15 Kernel5_15 = VersionCode(5, 15, 0) //nolint:deadcode,unused // Kernel5_16 is the KernelVersion representation of kernel version 5.16 Kernel5_16 = VersionCode(5, 16, 0) //nolint:deadcode,unused )
Functions ¶
This section is empty.
Types ¶
type Host ¶
type Host struct { OsRelease map[string]string OsReleasePath string Code Version UnameRelease string // contains filtered or unexported fields }
Host defines a the kernel and OS of a host helper
func (*Host) HaveMmapableMaps ¶
HaveMmapableMaps returns whether the kernel supports mmapable maps.
func (*Host) HaveRingBuffers ¶
HaveRingBuffers returns whether the kernel supports ring buffer.
func (*Host) IsAmazonLinuxKernel ¶
IsAmazonLinuxKernel returns whether the kernel is an amazon kernel
func (*Host) IsCOSKernel ¶
IsCOSKernel returns whether the kernel is a suse kernel
func (*Host) IsDebianKernel ¶
IsDebianKernel returns whether the kernel is a debian kernel
func (*Host) IsInRangeCloseOpen ¶
IsInRangeCloseOpen returns whether the kernel version is between the begin version (included) and the end version (excluded)
func (*Host) IsOracleUEKKernel ¶
IsOracleUEKKernel returns whether the kernel is an oracle uek kernel
func (*Host) IsRH7Kernel ¶
IsRH7Kernel returns whether the kernel is a rh7 kernel
func (*Host) IsRH8Kernel ¶
IsRH8Kernel returns whether the kernel is a rh8 kernel
func (*Host) IsSLESKernel ¶
IsSLESKernel returns whether the kernel is a sles kernel
func (*Host) IsSuse12Kernel ¶
IsSuse12Kernel returns whether the kernel is a sles 12 kernel
func (*Host) IsSuse15Kernel ¶
IsSuse15Kernel returns whether the kernel is a sles 15 kernel
func (*Host) IsSuseKernel ¶
IsSuseKernel returns whether the kernel is a suse kernel
func (*Host) IsUbuntuKernel ¶
IsUbuntuKernel returns whether the kernel is an ubuntu kernel
func (*Host) UbuntuKernelVersion ¶
func (k *Host) UbuntuKernelVersion() *UbuntuKernelVersion
UbuntuKernelVersion returns a parsed ubuntu kernel version or nil if not on ubuntu or if parsing failed
type UbuntuKernelVersion ¶
UbuntuKernelVersion represents a version from an ubuntu kernel Please see: https://ubuntu.com/kernel for the documentation of this scheme
func NewUbuntuKernelVersion ¶
func NewUbuntuKernelVersion(unameRelease string) (*UbuntuKernelVersion, error)
NewUbuntuKernelVersion parses the ubuntu release string and returns a structure with each extracted fields
type Version ¶
type Version uint32
Version is a numerical representation of a kernel version
func HostVersion ¶
HostVersion returns the running kernel version of the host
func ParseReleaseString ¶
ParseReleaseString converts a release string with format 4.4.2[-1] to a kernel version number in LINUX_VERSION_CODE format. That is, for kernel "a.b.c", the version number will be (a<<16 + b<<8 + c)
func ParseVersion ¶
ParseVersion parses a string in the format of x.x.x to a Version
func VersionCode ¶
VersionCode returns a Version computed from the individual parts of a x.x.x version