version

package
Version: v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package version gets the kernel and version information from the /proc/version file. Instead of returning a Go struct, it returns Flatbuffer serialized bytes. A function to deserialize the Flatbuffer serialized bytes into a version.Kernel struct is provided.

Note: the package name is version and not the final element of the import path (flat).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Deserialize

func Deserialize(p []byte) *v.Kernel

Deserialize takes some Flatbuffer serialized bytes and deserializes them as version.Kernel.

func Get

func Get() (p []byte, err error)

Get gets the kernel information from the /proc/version file as Flatbuffer serialized bytes using the package's global Profiler.

func Serialize

func Serialize(k *v.Kernel) (p []byte, err error)

Serialize version.Kernel as Flatbuffers using the package's global Profiler.

Types

type Profiler

type Profiler struct {
	*v.Profiler
	*fb.Builder
}

Profiler processes the version information, /proc/version, using Flatbuffers.

func NewProfiler

func NewProfiler() (prof *Profiler, err error)

Returns an initialized Profiler; ready to use.

func (*Profiler) Get

func (prof *Profiler) Get() ([]byte, error)

Get gets the kernel information from the /proc/version file as Flatbuffer serialized bytes.

func (*Profiler) Serialize

func (prof *Profiler) Serialize(k *v.Kernel) []byte

Serialize version.Kernel as Flatbuffers.

Source Files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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