src/api2/admin/datastore/backup.rs: implement upload chunk

This commit is contained in:
Dietmar Maurer
2019-05-09 13:06:09 +02:00
parent 4ebf0eabb0
commit 21ee7912fa
4 changed files with 123 additions and 11 deletions

View File

@ -19,7 +19,7 @@ pub struct OutputFormatter {
static JSON_CONTENT_TYPE: &str = "application/json;charset=UTF-8";
fn json_response(result: Value) -> Response<Body> {
pub fn json_response(result: Value) -> Response<Body> {
let json_str = result.to_string();
@ -50,7 +50,7 @@ fn json_format_result(data: Value, rpcenv: &RpcEnvironment) -> Response<Body> {
json_response(result)
}
fn json_format_error(err: Error) -> Response<Body> {
pub fn json_format_error(err: Error) -> Response<Body> {
let mut response = if let Some(apierr) = err.downcast_ref::<HttpError>() {
let mut resp = Response::new(Body::from(apierr.message.clone()));