Apache OpenDAL: access data freely.
APACHE-2.0 License
Bot releases are visible (Hide)
Published by Xuanwo over 2 years ago
Full Changelog: https://github.com/datafuselabs/opendal/compare/v0.7.3...v0.8.0
Published by Xuanwo over 2 years ago
Full Changelog: https://github.com/datafuselabs/opendal/compare/v0.7.2...v0.7.3
Published by Xuanwo over 2 years ago
Full Changelog: https://github.com/datafuselabs/opendal/compare/v0.7.1...v0.7.2
Published by Xuanwo over 2 years ago
Full Changelog: https://github.com/datafuselabs/opendal/compare/v0.7.0...v0.7.1
Published by Xuanwo over 2 years ago
Full Changelog: https://github.com/datafuselabs/opendal/compare/v0.6.3...v0.7.0
Published by Xuanwo over 2 years ago
Full Changelog: https://github.com/datafuselabs/opendal/compare/v0.6.2...v0.6.3
Published by Xuanwo over 2 years ago
Full Changelog: https://github.com/datafuselabs/opendal/compare/v0.6.1...v0.6.2
Published by Xuanwo over 2 years ago
Full Changelog: https://github.com/datafuselabs/opendal/compare/v0.6.0...v0.6.1
Published by Xuanwo over 2 years ago
Full Changelog: https://github.com/datafuselabs/opendal/compare/v0.5.2...v0.6.0
Published by Xuanwo over 2 years ago
Full Changelog: https://github.com/datafuselabs/opendal/compare/v0.5.1...v0.5.2
Published by Xuanwo over 2 years ago
Full Changelog: https://github.com/datafuselabs/opendal/compare/v0.5.0...v0.5.1
Published by Xuanwo over 2 years ago
This release introduces the following new features:
Now, we can create an empty file or directory without a trick!
Read Object::create
to know more!
let o = op.object("path/to/file");
let _ = o.create().await?;
let o = op.object("path/to/dir/");
let _ = o.create().await?;
Now, we can read a compressed file natively!
Enable compress
features:
opendal = {version="0.5.0", feautres=["compress"]}
Read with decompress_read()
or decompress_reader()
!
let o = op.object("path/to/file.gz");
let bs = o.decompress_read().await?;
With the help from @D2Lark, we have official support for azblob now!
Refer to azblob for more information.
// Create azblob backend builder.
let mut builder: Builder = azblob::Backend::build();
// Set the root for azblob, all operations will happen under this root.
//
// NOTE: the root must be absolute path.
builder.root("/path/to/dir");
// Set the container name, this is required.
builder.container("test");
// Set the endpoint, this is required.
//
// For examples:
// - "http://127.0.0.1:10000/devstoreaccount1"
// - "https://accountname.blob.core.windows.net"
builder.endpoint("http://127.0.0.1:10000/devstoreaccount1");
// Set the account_name and account_key.
//
// OpenDAL will try load credential from the env.
// If credential not set and no valid credential in env, OpenDAL will
// send request without signing like anonymous user.
builder.account_name("devstoreaccount1");
builder.account_key("Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==");
// Build the `Accessor`.
let accessor: Arc<dyn Accessor> = builder.finish().await?;
// `Accessor` provides the low level APIs, we will use `Operator` normally.
let op: Operator = Operator::new(accessor);
Full Changelog: https://github.com/datafuselabs/opendal/compare/v0.4.2...v0.5.0
Published by Xuanwo over 2 years ago
Full Changelog: https://github.com/datafuselabs/opendal/compare/v0.4.1...v0.4.2
Published by Xuanwo over 2 years ago
Full Changelog: https://github.com/datafuselabs/opendal/compare/v0.4.0...v0.4.1
Published by Xuanwo over 2 years ago
Full Changelog: https://github.com/datafuselabs/opendal/compare/v0.3.0...v0.4.0
Refer to Upgrade From v0.3 to v0.4
section for more upgrade details.
OpenDAL introduces many breaking changes in v0.4.
AsyncSeek
anymoreSince v0.4, Object::reader()
will return impl BytesRead
instead of Reader
that implements AsyncRead
and AsyncSeek
. Users who want AsyncSeek
please wrapped with opendal::io_util::seekable_read
:
use opendal::io_util::seekable_read;
let o = op.object("test");
let mut r = seekable_read(&o, 10..);
r.seek(SeekFrom::Current(10)).await?;
let mut bs = vec![0;10];
r.read(&mut bs).await?;
Since v0.4, the following APIs will be removed.
Object::limited_reader(size: u64)
Object::offset_reader(offset: u64)
Object::range_reader(offset: u64, size: u64)
Instead, OpenDAL is providing a more general range_reader
powered by RangeBounds
:
pub async fn range_reader(&self, range: impl RangeBounds<u64>) -> Result<impl BytesRead>
Users can use their familiar rust range syntax:
let r = o.range_reader(1024..2048).await?;
Since v0.4, all functions in OpenDAL will return std::io::Result
instead.
Please check via std::io::ErrorKind
directly:
use std::io::ErrorKind;
if let Err(e) = op.object("test_file").metadata().await {
if e.kind() == ErrorKind::NotFound {
println!("object not exist")
}
}
Since v0.4, Credential
has been removed, please use the API provided by Builder
directly.
builder.access_key_id("access_key_id");
builder.secret_access_key("secret_access_key");
BytesWriter
insteadSince v0.4, Accessor::write
will return a BytesWriter
instead accepting a BoxedAsyncReader
.
Along with this change, the old Writer
has been replaced by a new set of write functions:
pub async fn write(&self, bs: impl AsRef<[u8]>) -> Result<()> {}
pub async fn writer(&self, size: u64) -> Result<impl BytesWrite> {}
Users can write into an object more easily:
let _ = op.object("path/to/file").write("Hello, World!").await?;
io_util
replaces readers
Since v0.4, mod io_util
will replace readers
. In io_utils
, OpenDAL provides helpful functions like:
into_reader
: Convert BytesStream
into BytesRead
into_sink
: Convert BytesWrite
into BytesSink
into_stream
: Convert BytesRead
into BytesStream
into_writer
: Convert BytesSink
into BytesWrite
observe_read
: Add callback for BytesReader
observe_write
: Add callback for BytesWrite
For better naming, types that OpenDAL returns have been renamed:
AsyncRead + Unpin + Send
=> BytesRead
BoxedAsyncReader
=> BytesReader
AsyncWrite + Unpin + Send
=> BytesWrite
BoxedAsyncWriter
=> BytesWriter
ObjectStream
=> ObjectStreamer
Published by Xuanwo over 2 years ago
Full Changelog: https://github.com/datafuselabs/opendal/compare/v0.2.5...v0.3.0