pub struct ConfigStore { /* private fields */ }Expand description
File owner for gateway configuration and aggregate usage.
Implementations§
Source§impl ConfigStore
impl ConfigStore
Sourcepub fn initialize(
state_dir: PathBuf,
listen: SocketAddr,
tls: Option<TlsConfig>,
) -> Result<(Self, GatewayConfig)>
pub fn initialize( state_dir: PathBuf, listen: SocketAddr, tls: Option<TlsConfig>, ) -> Result<(Self, GatewayConfig)>
Initializes an owner-only state directory and new config file.
§Errors
Returns an error if configuration is invalid or a required resource cannot be initialized.
Sourcepub fn initialize_quick_cloudflare(
state_dir: PathBuf,
listen: SocketAddr,
) -> Result<(Self, GatewayConfig)>
pub fn initialize_quick_cloudflare( state_dir: PathBuf, listen: SocketAddr, ) -> Result<(Self, GatewayConfig)>
Initializes state for an account-free Cloudflare Quick Tunnel.
§Errors
Returns an error if configuration is invalid or a required resource cannot be initialized.
Sourcepub fn initialize_named_cloudflare(
state_dir: PathBuf,
listen: SocketAddr,
hostname: &str,
token: &str,
) -> Result<(Self, GatewayConfig)>
pub fn initialize_named_cloudflare( state_dir: PathBuf, listen: SocketAddr, hostname: &str, token: &str, ) -> Result<(Self, GatewayConfig)>
Initializes state for one user-owned Cloudflare Tunnel.
§Errors
Returns an error if configuration is invalid or a required resource cannot be initialized.
Sourcepub fn open(state_dir: PathBuf) -> Result<(Self, GatewayConfig)>
pub fn open(state_dir: PathBuf) -> Result<(Self, GatewayConfig)>
Opens and validates persisted gateway configuration.
§Errors
Returns an error if the resource cannot be read, decoded, or validated.
Sourcepub fn save(&self, config: &GatewayConfig) -> Result<()>
pub fn save(&self, config: &GatewayConfig) -> Result<()>
Atomically replaces validated persistent configuration.
§Errors
Returns an error if the value cannot be encoded or persisted.
Sourcepub fn credentials_path(&self) -> PathBuf
pub fn credentials_path(&self) -> PathBuf
Returns the provider credential file path.
Sourcepub fn provider_auth_path(&self) -> PathBuf
pub fn provider_auth_path(&self) -> PathBuf
Returns the provider browser-auth file path.
Sourcepub fn checkpoints_path(&self) -> PathBuf
pub fn checkpoints_path(&self) -> PathBuf
Returns the checkpoint database path.
Sourcepub fn cloudflare_token_path(&self) -> PathBuf
pub fn cloudflare_token_path(&self) -> PathBuf
Returns the owner-only Cloudflare connector-token path.