dwh

Trait FileMetaProvider

Source
pub trait FileMetaProvider {
    // Required methods
    fn modified(&self, path: &str) -> Result<Option<DateTime<Utc>>>;
    fn set_modified(&mut self, path: &str, date: DateTime<Utc>) -> Result<()>;
    fn len(&self, path: &str) -> Result<usize>;
    fn remove(&mut self, path: &str) -> Result<()>;
}
Expand description

provides a mechanism to get and set meta data for file that is used in the git backup mechanism the process uses the last modified time and the len to determine if a file has been changed. I know.. this isn’t the best option but we need to take the information we have. Some customers don’t grant us root permissions on their pvc storages in kubernetes. Without root privileges it is not possible to set the last modified timestamp of a file altough you’re the owner. That said we need a differen method to store that information and added this abstraction for this. usually the file system is used to store the last modified time. within the described circumstances we are using a json file as a database for the last modified date.

Required Methods§

Source

fn modified(&self, path: &str) -> Result<Option<DateTime<Utc>>>

Source

fn set_modified(&mut self, path: &str, date: DateTime<Utc>) -> Result<()>

Source

fn len(&self, path: &str) -> Result<usize>

Source

fn remove(&mut self, path: &str) -> Result<()>

Implementors§