os

package
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 os provides OS Release information, /etc/os-release. Instead of returning a Go struct, it returns Flatbuffer serialized bytes. A function to deserialize the Flatbuffer serialized bytes into an os.OS struct is provided.

Note: the package name is os 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) *o.OS

Deserialize takes some Flatbuffer serialized bytes and deserializes them as release.OS.

func Get

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

Get gets the OS release information, /etc/os-release, as Flatbuffer serialized bytes using the package's global Profiler.

func Serialize

func Serialize(os *o.OS) (p []byte, err error)

Serialize serializes OS release informationa as Flatbuffers using the package's global Profiler.

Types

type Profiler

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

Profiler processes the OS release information, /etc/os-release, 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 OS release information, /etc/os-release, as Flatbuffer serialized bytes.

func (*Profiler) Serialize

func (prof *Profiler) Serialize(os *o.OS) []byte

Serialize serializes OS release information as Flatbuffers.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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