ubootenv

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Env

type Env struct {
	// contains filtered or unexported fields
}

Env contains the data of the uboot environment

func Create

func Create(fname string, size int) (*Env, error)

Create a new empty uboot env file with the given size

func Open

func Open(fname string) (*Env, error)

Open opens a existing uboot env file

func OpenWithFlags

func OpenWithFlags(fname string, flags OpenFlags) (*Env, error)

OpenWithFlags opens a existing uboot env file, passing additional flags.

func (*Env) Get

func (env *Env) Get(name string) string

Get the value of the environment variable

func (*Env) Import

func (env *Env) Import(r io.Reader) error

Import is a helper that imports a given text file that contains "key=value" paris into the uboot env. Lines starting with ^# are ignored (like the input file on mkenvimage)

func (*Env) Save

func (env *Env) Save() error

Save will write out the environment data

func (*Env) Set

func (env *Env) Set(name, value string)

Set an environment name to the given value, if the value is empty the variable will be removed from the environment

func (*Env) Size

func (env *Env) Size() int

func (*Env) String

func (env *Env) String() string

type OpenFlags

type OpenFlags int

OpenFlags instructs open how to alter its behavior.

const (
	// OpenBestEffort instructs OpenWithFlags to skip malformed data without returning an error.
	OpenBestEffort OpenFlags = 1 << iota
)

Jump to

Keyboard shortcuts

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