krcalc's recent timeline updates
krcalc

krcalc

V2EX member #560829, joined on 2021-11-05 16:24:27 +08:00
krcalc's recent replies
docker + distroless 镜像 + python 应该不能更精简了
Jan 29, 2022
Replied to a topic by plko345 Rust 请教一个读取修改 xml 文件的问题
同新手,是我的话可能会用 quick-xml 和 serde
```rust
// serde = { version = "1.0", features = [ "derive" ] }
// quick-xml = { version = "0.22", features = [ "serialize" ] }
use std::fs;
use serde::{Serialize,Deserialize};
use quick_xml::de::from_str;
use quick_xml::se::to_string;


#[derive(Serialize,Deserialize)]
#[serde(rename = "this_tag")]
struct Thistag {
k1: Option<String>,
k2: Option<String>,
child: String,
atag: String
}


fn main() {
//let s = fs::read_to_string("test.xml").unwrap();
let s = r#"<this_tag k1="v1" k2="v2">
<child>
text
</child>
<atag>123123</atag>
</this_tag>"#;
let mut data: Thistag = from_str(&s).unwrap();
data.atag = String::from("abc");
let newxml =to_string(&data).unwrap();
println!("{}",newxml);
}
```
Nov 25, 2021
Replied to a topic by programV2 程序员 Docker 容器镜像 alpine VS Ubuntu 的竞争
还有 distroless
Nov 25, 2021
Replied to a topic by leiuu Kubernetes k8s kube-vip 配置
kube-vip 会生成一个 yaml 文件,在集群启动的时候启动 kube-vip 的 pod,配 kube-vip 直接启动就行。启动后改也不是不可以,看你自己
About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3361 Online   Highest 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 15ms · UTC 11:55 · PVG 19:55 · LAX 04:55 · JFK 07:55
♥ Do have faith in what you're doing.