Skip to main content

ConfigManager

Struct ConfigManager 

Source
pub struct ConfigManager { /* private fields */ }
Expand description

配置管理器

Implementations§

Source§

impl ConfigManager

Source

pub fn new() -> Result<Self>

创建新的配置管理器

Source

pub fn get_config(&self) -> Result<DockerConfig>

获取配置

Source

pub fn save_config(&self, config: &DockerConfig) -> Result<()>

保存配置

Source

pub fn create_config( &self, name: &str, data: &str, labels: HashMap<String, String>, ) -> Result<ConfigInfo>

创建配置

Source

pub fn update_config( &self, config_id: &str, data: &str, labels: HashMap<String, String>, ) -> Result<ConfigInfo>

更新配置

Source

pub fn delete_config(&self, config_id: &str) -> Result<()>

删除配置

Source

pub fn get_config_info(&self, config_id: &str) -> Result<ConfigInfo>

获取配置详细信息

Source

pub fn list_configs(&self) -> Result<Vec<ConfigInfo>>

列出所有配置

Source

pub fn create_secret( &self, name: &str, data: &str, labels: HashMap<String, String>, ) -> Result<SecretInfo>

创建密钥

Source

pub fn delete_secret(&self, secret_id: &str) -> Result<()>

删除密钥

Source

pub fn get_secret_info(&self, secret_id: &str) -> Result<SecretInfo>

获取密钥详细信息

Source

pub fn list_secrets(&self) -> Result<Vec<SecretInfo>>

列出所有密钥

Source

pub fn create_endpoint( &self, name: &str, endpoint_type: EndpointType, url: &str, use_tls: bool, tls_cert_path: Option<String>, tls_key_path: Option<String>, tls_ca_path: Option<String>, auth_token: Option<String>, labels: HashMap<String, String>, ) -> Result<EndpointInfo>

创建端点

Source

pub fn update_endpoint( &self, endpoint_id: &str, name: &str, url: &str, use_tls: bool, tls_cert_path: Option<String>, tls_key_path: Option<String>, tls_ca_path: Option<String>, auth_token: Option<String>, labels: HashMap<String, String>, ) -> Result<EndpointInfo>

更新端点

Source

pub fn delete_endpoint(&self, endpoint_id: &str) -> Result<()>

删除端点

Source

pub fn get_endpoint_info(&self, endpoint_id: &str) -> Result<EndpointInfo>

获取端点详细信息

Source

pub fn list_endpoints(&self) -> Result<Vec<EndpointInfo>>

列出所有端点

Source

pub fn test_endpoint_connection( &self, endpoint_id: &str, ) -> Result<EndpointStatus>

测试端点连接

Trait Implementations§

Source§

impl Default for ConfigManager

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.