mirror of https://github.com/tikv/website.git
Fix main.rs in the docker stack example (#212)
* fix main.rs in docker stack example Signed-off-by: David Ortiz <z.david.ortiz@gmail.com> * update Signed-off-by: andylokandy <andylokandy@hotmail.com> * fix typo Signed-off-by: andylokandy <andylokandy@hotmail.com> Co-authored-by: andylokandy <andylokandy@hotmail.com>
This commit is contained in:
parent
d045e2f820
commit
77da11c85b
|
|
@ -260,7 +260,7 @@ Next, you'll need to add the TiKV client as a dependency in the `Cargo.toml` fil
|
|||
```toml
|
||||
[dependencies]
|
||||
tikv-client = { git = "https://github.com/tikv/client-rust.git" }
|
||||
tokio = "0.2.0-alpha.4"
|
||||
tokio = "1"
|
||||
```
|
||||
|
||||
Then you can edit the `src/main.rs` file with the following:
|
||||
|
|
@ -270,8 +270,7 @@ use tikv_client::{Config, RawClient, Error};
|
|||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<(), Error> {
|
||||
let config = Config::new(vec!["http://pd.tikv:2379"]);
|
||||
let client = RawClient::new(config)?;
|
||||
let client = RawClient::new(vec!["127.0.0.1:2379"], None).await?;
|
||||
let key = "TiKV".as_bytes().to_owned();
|
||||
let value = "Works!".as_bytes().to_owned();
|
||||
|
||||
|
|
|
|||
|
|
@ -260,7 +260,7 @@ Next, you'll need to add the TiKV client as a dependency in the `Cargo.toml` fil
|
|||
```toml
|
||||
[dependencies]
|
||||
tikv-client = { git = "https://github.com/tikv/client-rust.git" }
|
||||
tokio = "0.2.0-alpha.4"
|
||||
tokio = "1"
|
||||
```
|
||||
|
||||
Then you can edit the `src/main.rs` file with the following:
|
||||
|
|
@ -270,8 +270,7 @@ use tikv_client::{Config, RawClient, Error};
|
|||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<(), Error> {
|
||||
let config = Config::new(vec!["http://pd.tikv:2379"]);
|
||||
let client = RawClient::new(config)?;
|
||||
let client = RawClient::new(vec!["127.0.0.1:2379"], None).await?;
|
||||
let key = "TiKV".as_bytes().to_owned();
|
||||
let value = "Works!".as_bytes().to_owned();
|
||||
|
||||
|
|
|
|||
|
|
@ -260,7 +260,7 @@ Next, you'll need to add the TiKV client as a dependency in the `Cargo.toml` fil
|
|||
```toml
|
||||
[dependencies]
|
||||
tikv-client = { git = "https://github.com/tikv/client-rust.git" }
|
||||
tokio = "0.2.0-alpha.4"
|
||||
tokio = "1"
|
||||
```
|
||||
|
||||
Then you can edit the `src/main.rs` file with the following:
|
||||
|
|
@ -270,8 +270,8 @@ use tikv_client::{Config, RawClient, Error};
|
|||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<(), Error> {
|
||||
let config = Config::new(vec!["http://pd.tikv:2379"]);
|
||||
let client = RawClient::new(config)?;
|
||||
let client = RawClient::new(vec!["127.0.0.1:2379"], None).await?;
|
||||
|
||||
let key = "TiKV".as_bytes().to_owned();
|
||||
let value = "Works!".as_bytes().to_owned();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue