pub struct FileManager {}Expand description
Manages all the file system interactions
Implementations§
Source§impl FileManager
impl FileManager
pub fn boot_url() -> &'static str
pub fn file_exists(path: &str) -> bool
Sourcepub fn job_folder() -> &'static str
pub fn job_folder() -> &'static str
gets the name of the job folder
pub fn is_local() -> &'static str
Sourcepub fn readfile(file_path: String) -> Result<String, Error>
pub fn readfile(file_path: String) -> Result<String, Error>
Simple wrapper around the read_to_string
Sourcepub fn resolve_quadit_config_location() -> String
pub fn resolve_quadit_config_location() -> String
Generates the location of the quadit config.
Sourcepub fn job_exists(uuid: Uuid) -> bool
pub fn job_exists(uuid: Uuid) -> bool
Test to see if the job folder exists. Used to validate if this is the first time the job has ran.
§Arguments
uuid - The uuid of the job - Usually xxxxxxxx-xxxx-4xxx-Nxxx-xxxxxxxxxxxx.
Sourcepub fn quadit_home() -> String
pub fn quadit_home() -> String
Gets the home location of the user currently running quadit
Sourcepub fn load_quadit_config() -> Result<String, Error>
pub fn load_quadit_config() -> Result<String, Error>
Loads the quadit config based on the resolved location.
Sourcepub fn filename_to_unit_name(target_path: &str) -> Result<String, String>
pub fn filename_to_unit_name(target_path: &str) -> Result<String, String>
converts the quadlet file name to a service name with some additional checks.
Sourcepub fn container_file_deployed(job_path: &str, target_path: &str) -> bool
pub fn container_file_deployed(job_path: &str, target_path: &str) -> bool
Test to see if a file exists in the container deployment location
Currently ~/.config/containers/systemd/ but this may be expanded in later releases.
§Arguments
job_path - The path to the job - Usually jobs/xxxxxxxx-xxxx-4xxx-Nxxx-xxxxxxxxxxxx.
target_path - The path of the file in the git repo
Sourcepub fn get_files_in_directory(path: &str) -> Result<Vec<String>, Error>
pub fn get_files_in_directory(path: &str) -> Result<Vec<String>, Error>
Collects a directory contents as a vector of strings