FlatImage
A configurable Linux containerization system
Loading...
Searching...
No Matches
ns_db::ns_env Namespace Reference

Environment variable database management. More...

Functions

Value< void > del (fs::path const &path_file_binary, std::vector< std::string > const &entries)
 Deletes a list of environment variables from the database.
 
Value< void > add (fs::path const &path_file_binary, std::vector< std::string > const &entries)
 Adds a new environment variable to the database.
 
Value< void > set (fs::path const &path_file_binary, std::vector< std::string > const &entries)
 Resets all defined environment variables to the ones passed as an argument.
 
Value< std::vector< std::string > > get (fs::path const &path_file_binary)
 Get existing variables from the database.
 

Detailed Description

Environment variable database management.

Manages environment variables stored in FlatImage's reserved space. Provides validation, serialization/deserialization, and key-value parsing for environment entries in 'KEY=VALUE' format. Supports reading from and writing to the binary's embedded configuration with configurable environment variable injection into the container.

Function Documentation

◆ add()

Value< void > ns_db::ns_env::add ( fs::path const & path_file_binary,
std::vector< std::string > const & entries )
inlinenodiscard

Adds a new environment variable to the database.

Parameters
path_file_binaryThe path to the environment variable database
entriesList of environment variables to append to the existing ones
Returns
Nothing on success, or the respective error

Definition at line 108 of file env.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ del()

Value< void > ns_db::ns_env::del ( fs::path const & path_file_binary,
std::vector< std::string > const & entries )
inlinenodiscard

Deletes a list of environment variables from the database.

Parameters
path_file_binaryPath to the database with environment variables
entriesList of environment variables to erase

Definition at line 83 of file env.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get()

Value< std::vector< std::string > > ns_db::ns_env::get ( fs::path const & path_file_binary)
inlinenodiscard

Get existing variables from the database.

Parameters
path_file_binaryThe path to the environment variable database
Returns
The list of environment variables, or the respective error

Definition at line 144 of file env.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set()

Value< void > ns_db::ns_env::set ( fs::path const & path_file_binary,
std::vector< std::string > const & entries )
inlinenodiscard

Resets all defined environment variables to the ones passed as an argument.

Parameters
path_file_binaryThe path to the environment variable database
entriesList of environment variables to set
Returns
Nothing on success, or the respective error

Definition at line 131 of file env.hpp.

Here is the call graph for this function:
Here is the caller graph for this function: