Skip to content

Commit 9da1ed9

Browse files
committed
feat(services/github): implement write returns metadata
1 parent 29f74a9 commit 9da1ed9

File tree

127 files changed

+972
-777
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+972
-777
lines changed

bindings/nodejs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
"test": "vitest",
7474
"bench": "node -r dotenv/config ./benchmark/node.js dotenv_config_path=./.env",
7575
"bench:deno": "deno bench ./benchmark/deno.ts --reload=npm:opendal --allow-read --allow-ffi --allow-net --allow-env",
76-
"prepublishOnly": "napi prepublish -t npm"
76+
"prepublishOnly": "napi prepublish -t npm --skip-gh-release"
7777
},
7878
"prettier": {
7979
"overrides": [

core/benches/types/buffer.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717

1818
use bytes::Buf;
1919
use bytes::Bytes;
20-
use divan::{black_box, Bencher};
20+
use divan::black_box;
21+
use divan::Bencher;
2122
use opendal::Buffer;
2223

2324
mod chunk {

core/benches/types/tasks.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515
// specific language governing permissions and limitations
1616
// under the License.
1717

18+
use std::sync::LazyLock;
1819
use std::time::Duration;
1920

2021
use divan::Bencher;
2122
use opendal::raw::ConcurrentTasks;
2223
use opendal::Executor;
23-
use std::sync::LazyLock;
2424

2525
pub static TOKIO: LazyLock<tokio::runtime::Runtime> =
2626
LazyLock::new(|| tokio::runtime::Runtime::new().expect("build tokio runtime"));

core/src/blocking/operator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,11 +361,11 @@ impl Operator {
361361
///
362362
/// ```no_run
363363
/// # use opendal::Result;
364-
/// use opendal::blocking;
365364
/// # use opendal::blocking::Operator;
366365
/// # use futures::StreamExt;
367366
/// # use futures::SinkExt;
368367
/// use bytes::Bytes;
368+
/// use opendal::blocking;
369369
///
370370
/// # fn test(op: blocking::Operator) -> Result<()> {
371371
/// op.write("path/to/file", vec![0; 4096])?;

core/src/blocking/read/reader.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,11 @@ use std::ops::RangeBounds;
1919

2020
use bytes::BufMut;
2121

22-
use crate::Reader as AsyncReader;
23-
use crate::*;
24-
2522
use super::BufferIterator;
2623
use super::StdBytesIterator;
2724
use super::StdReader;
25+
use crate::Reader as AsyncReader;
26+
use crate::*;
2827

2928
/// BlockingReader is designed to read data from given path in an blocking
3029
/// manner.

core/src/layers/capability_check.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@
1515
// specific language governing permissions and limitations
1616
// under the License.
1717

18+
use std::fmt::Debug;
19+
use std::fmt::Formatter;
20+
use std::sync::Arc;
21+
1822
use crate::layers::correctness_check::new_unsupported_error;
1923
use crate::raw::*;
20-
use std::fmt::{Debug, Formatter};
21-
use std::sync::Arc;
2224

2325
/// Add an extra capability check layer for every operation
2426
///
@@ -141,7 +143,9 @@ impl<A: Access> LayeredAccess for CapabilityAccessor<A> {
141143
#[cfg(test)]
142144
mod tests {
143145
use super::*;
144-
use crate::{Capability, ErrorKind, Operator};
146+
use crate::Capability;
147+
use crate::ErrorKind;
148+
use crate::Operator;
145149

146150
#[derive(Debug)]
147151
struct MockService {

core/src/layers/complete.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,16 @@
1515
// specific language governing permissions and limitations
1616
// under the License.
1717

18-
use crate::raw::oio::FlatLister;
19-
use crate::raw::oio::PrefixLister;
20-
use crate::raw::*;
21-
use crate::*;
2218
use std::cmp::Ordering;
2319
use std::fmt::Debug;
2420
use std::fmt::Formatter;
2521
use std::sync::Arc;
2622

23+
use crate::raw::oio::FlatLister;
24+
use crate::raw::oio::PrefixLister;
25+
use crate::raw::*;
26+
use crate::*;
27+
2728
/// Complete underlying services features so that users can use them in
2829
/// the same way.
2930
///
@@ -51,7 +52,6 @@ use std::sync::Arc;
5152
///
5253
/// - If support `list_with_recursive`, return directly.
5354
/// - if not, wrap with [`FlatLister`].
54-
///
5555
pub struct CompleteLayer;
5656

5757
impl<A: Access> Layer<A> for CompleteLayer {

core/src/layers/correctness_check.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
// specific language governing permissions and limitations
1616
// under the License.
1717

18-
use std::fmt::{Debug, Formatter};
18+
use std::fmt::Debug;
19+
use std::fmt::Formatter;
1920
use std::future::Future;
2021
use std::sync::Arc;
2122

@@ -252,7 +253,10 @@ impl<T: oio::Delete> oio::Delete for CheckWrapper<T> {
252253
mod tests {
253254
use super::*;
254255
use crate::raw::oio;
255-
use crate::{Capability, EntryMode, Metadata, Operator};
256+
use crate::Capability;
257+
use crate::EntryMode;
258+
use crate::Metadata;
259+
use crate::Operator;
256260

257261
#[derive(Debug)]
258262
struct MockService {

core/src/layers/mime_guess.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,12 @@ impl<A: Access> LayeredAccess for MimeGuessAccessor<A> {
142142

143143
#[cfg(test)]
144144
mod tests {
145+
use futures::TryStreamExt;
146+
145147
use super::*;
146148
use crate::services::Memory;
147149
use crate::Metadata;
148150
use crate::Operator;
149-
use futures::TryStreamExt;
150151

151152
const DATA: &str = "<html>test</html>";
152153
const CUSTOM: &str = "text/custom";

core/src/layers/otelmetrics.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,7 @@ impl OtelMetricsLayerBuilder {
161161
/// # async fn main() -> Result<()> {
162162
/// let meter = opentelemetry::global::meter("opendal");
163163
/// let op = Operator::new(services::Memory::default())?
164-
/// .layer(OtelMetricsLayer::builder()
165-
/// .register(&meter))
164+
/// .layer(OtelMetricsLayer::builder().register(&meter))
166165
/// .finish();
167166
///
168167
/// Ok(())

0 commit comments

Comments
 (0)