pub struct ProjectConfig {
pub remote: RemoteConfig,
pub deploy: DeployConfig,
}Expand description
Project-level configuration stored in .varpulis.toml.
This file stores the remote server URL and API key so that CLI commands
like deploy, status, pipelines, and undeploy don’t need
--server and --api-key flags on every invocation.
§Example .varpulis.toml:
[remote]
url = "http://localhost:9000"
api_key = "my-secret-key"
[deploy]
name = "my-pipeline"Fields§
§remote: RemoteConfigRemote server connection settings
deploy: DeployConfigDefault deploy settings
Implementations§
Source§impl ProjectConfig
impl ProjectConfig
Sourcepub fn load<P: AsRef<Path>>(path: P) -> Result<Self, ConfigError>
pub fn load<P: AsRef<Path>>(path: P) -> Result<Self, ConfigError>
Load project config from a .varpulis.toml file.
Sourcepub fn discover(start_dir: &Path) -> Option<Self>
pub fn discover(start_dir: &Path) -> Option<Self>
Discover .varpulis.toml by walking up from the given directory.
Returns None if no config file is found.
Sourcepub fn discover_cwd() -> Option<Self>
pub fn discover_cwd() -> Option<Self>
Discover from the current working directory.
Sourcepub fn resolve_url(&self, cli_flag: Option<&str>) -> Option<String>
pub fn resolve_url(&self, cli_flag: Option<&str>) -> Option<String>
Resolve the server URL: CLI flag > env var > project config.
Trait Implementations§
Source§impl Clone for ProjectConfig
impl Clone for ProjectConfig
Source§fn clone(&self) -> ProjectConfig
fn clone(&self) -> ProjectConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ProjectConfig
impl Debug for ProjectConfig
Source§impl Default for ProjectConfig
impl Default for ProjectConfig
Source§fn default() -> ProjectConfig
fn default() -> ProjectConfig
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ProjectConfigwhere
ProjectConfig: Default,
impl<'de> Deserialize<'de> for ProjectConfigwhere
ProjectConfig: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ProjectConfig
impl RefUnwindSafe for ProjectConfig
impl Send for ProjectConfig
impl Sync for ProjectConfig
impl Unpin for ProjectConfig
impl UnsafeUnpin for ProjectConfig
impl UnwindSafe for ProjectConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more