Skip to content

Commit

Permalink
add append for oss
Browse files Browse the repository at this point in the history
Signed-off-by: suyanhanx <suyanhanx@gmail.com>
  • Loading branch information
suyanhanx committed May 23, 2023
1 parent d0498cc commit 46a765b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 0 additions & 1 deletion core/src/services/oss/appender.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ pub struct OssAppender {
}

impl OssAppender {
#[allow(dead_code)]
pub fn new(core: Arc<OssCore>, path: &str, op: OpAppend) -> Self {
Self {
core,
Expand Down
10 changes: 9 additions & 1 deletion core/src/services/oss/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ use reqsign::AliyunConfig;
use reqsign::AliyunLoader;
use reqsign::AliyunOssSigner;

use super::appender::OssAppender;
use super::core::*;
use super::error::parse_error;
use super::pager::OssPager;
Expand Down Expand Up @@ -441,7 +442,7 @@ impl Accessor for OssBackend {
type BlockingReader = ();
type Writer = OssWriter;
type BlockingWriter = ();
type Appender = ();
type Appender = OssAppender;
type Pager = OssPager;
type BlockingPager = ();

Expand Down Expand Up @@ -538,6 +539,13 @@ impl Accessor for OssBackend {
))
}

async fn append(&self, path: &str, args: OpAppend) -> Result<(RpAppend, Self::Appender)> {
Ok((
RpAppend::default(),
OssAppender::new(self.core.clone(), path, args),
))
}

async fn copy(&self, from: &str, to: &str, _args: OpCopy) -> Result<RpCopy> {
let resp = self.core.oss_copy_object(from, to).await?;
let status = resp.status();
Expand Down

0 comments on commit 46a765b

Please sign in to comment.