pub trait Factory: Send + Sync {
    // Required methods
    fn get_db_connection<'life0, 'async_trait>(
        &'life0 mut self,
        db_type: Type
    ) -> Pin<Box<dyn Future<Output = Result<DatabaseReadyInfo, Error>> + Send + 'async_trait, Global>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn get_secrets<'life0, 'async_trait>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = Result<BTreeMap<String, String, Global>, Error>> + Send + 'async_trait, Global>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn get_service_name(&self) -> ProjectName;
    fn get_environment(&self) -> Environment;
    fn get_build_path(&self) -> Result<PathBuf, Error>;
    fn get_storage_path(&self) -> Result<PathBuf, Error>;
}
Expand description

Factories can be used to request the provisioning of additional resources (like databases).

An instance of factory is passed by the deployer as an argument to ResourceBuilder::build in the initial phase of deployment.

Also see the main macro.

Required Methods§

source

fn get_db_connection<'life0, 'async_trait>( &'life0 mut self, db_type: Type ) -> Pin<Box<dyn Future<Output = Result<DatabaseReadyInfo, Error>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: 'async_trait,

Get a database connection

source

fn get_secrets<'life0, 'async_trait>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = Result<BTreeMap<String, String, Global>, Error>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: 'async_trait,

Get all the secrets for a service

source

fn get_service_name(&self) -> ProjectName

Get the name for the service being deployed

source

fn get_environment(&self) -> Environment

Get the environment for this deployment

source

fn get_build_path(&self) -> Result<PathBuf, Error>

Get the path where the build files are stored for this service

source

fn get_storage_path(&self) -> Result<PathBuf, Error>

Get the path where files can be stored for this deployment

Implementors§