This repository has been archived by the owner on Aug 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 337
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1332 from cloudflare/alewis/commands-refactor-kv
Alewis/commands refactor kv
- Loading branch information
Showing
31 changed files
with
355 additions
and
316 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,28 @@ | ||
pub mod delete; | ||
pub mod put; | ||
|
||
pub use delete::delete; | ||
pub use put::put; | ||
pub use delete::run as delete; | ||
pub use put::run as put; | ||
|
||
const MAX_PAIRS: usize = 10000; | ||
use std::time::Duration; | ||
|
||
use cloudflare::framework::auth::Credentials; | ||
use cloudflare::framework::{Environment, HttpApiClient, HttpApiClientConfig}; | ||
|
||
use crate::http::feature::headers; | ||
use crate::settings::global_user::GlobalUser; | ||
|
||
// Create a special API client that has a longer timeout than usual, given that KV operations | ||
// can be lengthy if payloads are large. | ||
fn bulk_api_client(user: &GlobalUser) -> Result<HttpApiClient, failure::Error> { | ||
let config = HttpApiClientConfig { | ||
http_timeout: Duration::from_secs(5 * 60), | ||
default_headers: headers(None), | ||
}; | ||
|
||
HttpApiClient::new( | ||
Credentials::from(user.to_owned()), | ||
config, | ||
Environment::Production, | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
mod delete; | ||
mod get; | ||
mod key_list; | ||
mod list; | ||
mod put; | ||
|
||
pub use delete::delete; | ||
pub use get::get; | ||
pub use key_list::KeyList; | ||
pub use list::list; | ||
pub use put::{put, KVMetaData}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.