You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by gi...@apache.org on 2024/07/19 03:01:17 UTC

(opendal-go-services) 01/01: Auto commit by GitHub Actions v0.47.3

This is an automated email from the ASF dual-hosted git repository.

github-bot pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/opendal-go-services.git

commit 74ff217cfef9515bc6838fe5c451d5d7d62e1a82
Author: Github Actions <ac...@github.com>
AuthorDate: Fri Jul 19 03:01:08 2024 +0000

    Auto commit by GitHub Actions v0.47.3
---
 aliyun_drive/embed_linux_amd64.go            |  25 +++++++
 aliyun_drive/embed_linux_arm64.go            |  25 +++++++
 aliyun_drive/go.mod                          |  14 ++++
 aliyun_drive/go.sum                          |  12 ++++
 aliyun_drive/libopendal_c.linux.amd64.so.zst | Bin 0 -> 1879191 bytes
 aliyun_drive/libopendal_c.linux.arm64.so.zst | Bin 0 -> 1895040 bytes
 aliyun_drive/service.go                      | 104 +++++++++++++++++++++++++++
 aliyun_drive/service_test.go                 |  39 ++++++++++
 fs/embed_linux_amd64.go                      |  25 +++++++
 fs/embed_linux_arm64.go                      |  25 +++++++
 fs/go.mod                                    |  14 ++++
 fs/go.sum                                    |  12 ++++
 fs/libopendal_c.linux.amd64.so.zst           | Bin 0 -> 608291 bytes
 fs/libopendal_c.linux.arm64.so.zst           | Bin 0 -> 615171 bytes
 fs/service.go                                | 104 +++++++++++++++++++++++++++
 fs/service_test.go                           |  39 ++++++++++
 gdrive/embed_linux_amd64.go                  |  25 +++++++
 gdrive/embed_linux_arm64.go                  |  25 +++++++
 gdrive/go.mod                                |  14 ++++
 gdrive/go.sum                                |  12 ++++
 gdrive/libopendal_c.linux.amd64.so.zst       | Bin 0 -> 2008670 bytes
 gdrive/libopendal_c.linux.arm64.so.zst       | Bin 0 -> 2025829 bytes
 gdrive/service.go                            | 104 +++++++++++++++++++++++++++
 gdrive/service_test.go                       |  39 ++++++++++
 memory/embed_linux_amd64.go                  |  25 +++++++
 memory/embed_linux_arm64.go                  |  25 +++++++
 memory/go.mod                                |  14 ++++
 memory/go.sum                                |  12 ++++
 memory/libopendal_c.linux.amd64.so.zst       | Bin 0 -> 452982 bytes
 memory/libopendal_c.linux.arm64.so.zst       | Bin 0 -> 465076 bytes
 memory/service.go                            | 104 +++++++++++++++++++++++++++
 memory/service_test.go                       |  39 ++++++++++
 s3/embed_linux_amd64.go                      |  25 +++++++
 s3/embed_linux_arm64.go                      |  25 +++++++
 s3/go.mod                                    |  14 ++++
 s3/go.sum                                    |  12 ++++
 s3/libopendal_c.linux.amd64.so.zst           | Bin 0 -> 2126075 bytes
 s3/libopendal_c.linux.arm64.so.zst           | Bin 0 -> 2153665 bytes
 s3/service.go                                | 104 +++++++++++++++++++++++++++
 s3/service_test.go                           |  39 ++++++++++
 40 files changed, 1095 insertions(+)

diff --git a/aliyun_drive/embed_linux_amd64.go b/aliyun_drive/embed_linux_amd64.go
new file mode 100755
index 0000000..1d31d2d
--- /dev/null
+++ b/aliyun_drive/embed_linux_amd64.go
@@ -0,0 +1,25 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+// generated by github.com/apache/opendal-go-services
+
+package aliyun_drive
+
+import _ "embed"
+
+//go:embed libopendal_c.linux.amd64.so.zst
+var libopendalZst []byte
diff --git a/aliyun_drive/embed_linux_arm64.go b/aliyun_drive/embed_linux_arm64.go
new file mode 100755
index 0000000..edcb345
--- /dev/null
+++ b/aliyun_drive/embed_linux_arm64.go
@@ -0,0 +1,25 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+// generated by github.com/apache/opendal-go-services
+
+package aliyun_drive
+
+import _ "embed"
+
+//go:embed libopendal_c.linux.arm64.so.zst
+var libopendalZst []byte
diff --git a/aliyun_drive/go.mod b/aliyun_drive/go.mod
new file mode 100755
index 0000000..a1a30fb
--- /dev/null
+++ b/aliyun_drive/go.mod
@@ -0,0 +1,14 @@
+module github.com/apache/opendal-go-services/aliyun_drive
+
+go 1.22.4
+
+require (
+	github.com/klauspost/compress v1.17.9
+	github.com/stretchr/testify v1.9.0
+)
+
+require (
+	github.com/davecgh/go-spew v1.1.1 // indirect
+	github.com/pmezard/go-difflib v1.0.0 // indirect
+	gopkg.in/yaml.v3 v3.0.1 // indirect
+)
diff --git a/aliyun_drive/go.sum b/aliyun_drive/go.sum
new file mode 100644
index 0000000..30739e7
--- /dev/null
+++ b/aliyun_drive/go.sum
@@ -0,0 +1,12 @@
+github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
+github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA=
+github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw=
+github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
+github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
+github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
+github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
+gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
+gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
+gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
diff --git a/aliyun_drive/libopendal_c.linux.amd64.so.zst b/aliyun_drive/libopendal_c.linux.amd64.so.zst
new file mode 100644
index 0000000..43a5e18
Binary files /dev/null and b/aliyun_drive/libopendal_c.linux.amd64.so.zst differ
diff --git a/aliyun_drive/libopendal_c.linux.arm64.so.zst b/aliyun_drive/libopendal_c.linux.arm64.so.zst
new file mode 100644
index 0000000..127d26b
Binary files /dev/null and b/aliyun_drive/libopendal_c.linux.arm64.so.zst differ
diff --git a/aliyun_drive/service.go b/aliyun_drive/service.go
new file mode 100755
index 0000000..69611fd
--- /dev/null
+++ b/aliyun_drive/service.go
@@ -0,0 +1,104 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+// generated by github.com/apache/opendal-go-services
+
+package aliyun_drive
+
+import (
+	"bytes"
+	"fmt"
+	"io"
+	"os"
+	"sync"
+
+	"github.com/klauspost/compress/zstd"
+)
+
+var Scheme = scheme{once: &sync.Once{}}
+
+type scheme struct {
+	once *sync.Once
+}
+
+func (scheme) Name() string {
+	return "aliyun_drive"
+}
+
+func (s scheme) Path() string {
+	return path
+}
+
+func (s scheme) LoadOnce() error {
+	var err error
+	s.once.Do(func() {
+		err = load()
+		if err != nil {
+			err = fmt.Errorf("opendal/services/aliyun_drive: %s", err)
+		}
+	})
+	return err
+}
+
+var path string
+
+func load() error {
+	data, err := decompressLib(libopendalZst)
+	if err != nil {
+		return err
+	}
+	path, err = writeTempExec("libopendal_c*.so", data)
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+func writeTempExec(pattern string, binary []byte) (path string, err error) {
+	f, err := os.CreateTemp("", pattern)
+	if err != nil {
+		err = fmt.Errorf("cannot create temp file: %s", err)
+		return
+	}
+	defer f.Close()
+	_, err = f.Write(binary)
+	if err != nil {
+		err = fmt.Errorf("cannot write binary: %s", err)
+		return
+	}
+	err = f.Chmod(os.ModePerm)
+	if err != nil {
+		err = fmt.Errorf("cannot chmod: %s", err)
+		return
+	}
+	path = f.Name()
+	return
+}
+
+func decompressLib(raw []byte) (data []byte, err error) {
+	decoder, err := zstd.NewReader(bytes.NewReader(raw))
+	if err != nil {
+		err = fmt.Errorf("cannot create zstd reader: %s", err)
+		return
+	}
+	defer decoder.Close()
+	data, err = io.ReadAll(decoder)
+	if err != nil {
+		err = fmt.Errorf("cannot reading decompressed data: %s", err)
+	}
+	return
+}
diff --git a/aliyun_drive/service_test.go b/aliyun_drive/service_test.go
new file mode 100755
index 0000000..5896f22
--- /dev/null
+++ b/aliyun_drive/service_test.go
@@ -0,0 +1,39 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+// generated by github.com/apache/opendal-go-services
+
+package aliyun_drive_test
+
+import (
+	"os"
+	"testing"
+
+	"github.com/stretchr/testify/require"
+	"github.com/apache/opendal-go-services/aliyun_drive"
+)
+
+func TestScheme(t *testing.T) {
+	t.Parallel()
+	assert := require.New(t)
+
+	assert.Nil(aliyun_drive.Scheme.LoadOnce())
+	path := aliyun_drive.Scheme.Path()
+	assert.NotEmpty(path)
+	assert.Nil(os.Remove(path))
+}
+
diff --git a/fs/embed_linux_amd64.go b/fs/embed_linux_amd64.go
new file mode 100755
index 0000000..74426f8
--- /dev/null
+++ b/fs/embed_linux_amd64.go
@@ -0,0 +1,25 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+// generated by github.com/apache/opendal-go-services
+
+package fs
+
+import _ "embed"
+
+//go:embed libopendal_c.linux.amd64.so.zst
+var libopendalZst []byte
diff --git a/fs/embed_linux_arm64.go b/fs/embed_linux_arm64.go
new file mode 100755
index 0000000..0ff1317
--- /dev/null
+++ b/fs/embed_linux_arm64.go
@@ -0,0 +1,25 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+// generated by github.com/apache/opendal-go-services
+
+package fs
+
+import _ "embed"
+
+//go:embed libopendal_c.linux.arm64.so.zst
+var libopendalZst []byte
diff --git a/fs/go.mod b/fs/go.mod
new file mode 100755
index 0000000..329491b
--- /dev/null
+++ b/fs/go.mod
@@ -0,0 +1,14 @@
+module github.com/apache/opendal-go-services/fs
+
+go 1.22.4
+
+require (
+	github.com/klauspost/compress v1.17.9
+	github.com/stretchr/testify v1.9.0
+)
+
+require (
+	github.com/davecgh/go-spew v1.1.1 // indirect
+	github.com/pmezard/go-difflib v1.0.0 // indirect
+	gopkg.in/yaml.v3 v3.0.1 // indirect
+)
diff --git a/fs/go.sum b/fs/go.sum
new file mode 100644
index 0000000..30739e7
--- /dev/null
+++ b/fs/go.sum
@@ -0,0 +1,12 @@
+github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
+github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA=
+github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw=
+github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
+github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
+github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
+github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
+gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
+gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
+gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
diff --git a/fs/libopendal_c.linux.amd64.so.zst b/fs/libopendal_c.linux.amd64.so.zst
new file mode 100644
index 0000000..de2619b
Binary files /dev/null and b/fs/libopendal_c.linux.amd64.so.zst differ
diff --git a/fs/libopendal_c.linux.arm64.so.zst b/fs/libopendal_c.linux.arm64.so.zst
new file mode 100644
index 0000000..1b1b763
Binary files /dev/null and b/fs/libopendal_c.linux.arm64.so.zst differ
diff --git a/fs/service.go b/fs/service.go
new file mode 100755
index 0000000..e67c5fc
--- /dev/null
+++ b/fs/service.go
@@ -0,0 +1,104 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+// generated by github.com/apache/opendal-go-services
+
+package fs
+
+import (
+	"bytes"
+	"fmt"
+	"io"
+	"os"
+	"sync"
+
+	"github.com/klauspost/compress/zstd"
+)
+
+var Scheme = scheme{once: &sync.Once{}}
+
+type scheme struct {
+	once *sync.Once
+}
+
+func (scheme) Name() string {
+	return "fs"
+}
+
+func (s scheme) Path() string {
+	return path
+}
+
+func (s scheme) LoadOnce() error {
+	var err error
+	s.once.Do(func() {
+		err = load()
+		if err != nil {
+			err = fmt.Errorf("opendal/services/fs: %s", err)
+		}
+	})
+	return err
+}
+
+var path string
+
+func load() error {
+	data, err := decompressLib(libopendalZst)
+	if err != nil {
+		return err
+	}
+	path, err = writeTempExec("libopendal_c*.so", data)
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+func writeTempExec(pattern string, binary []byte) (path string, err error) {
+	f, err := os.CreateTemp("", pattern)
+	if err != nil {
+		err = fmt.Errorf("cannot create temp file: %s", err)
+		return
+	}
+	defer f.Close()
+	_, err = f.Write(binary)
+	if err != nil {
+		err = fmt.Errorf("cannot write binary: %s", err)
+		return
+	}
+	err = f.Chmod(os.ModePerm)
+	if err != nil {
+		err = fmt.Errorf("cannot chmod: %s", err)
+		return
+	}
+	path = f.Name()
+	return
+}
+
+func decompressLib(raw []byte) (data []byte, err error) {
+	decoder, err := zstd.NewReader(bytes.NewReader(raw))
+	if err != nil {
+		err = fmt.Errorf("cannot create zstd reader: %s", err)
+		return
+	}
+	defer decoder.Close()
+	data, err = io.ReadAll(decoder)
+	if err != nil {
+		err = fmt.Errorf("cannot reading decompressed data: %s", err)
+	}
+	return
+}
diff --git a/fs/service_test.go b/fs/service_test.go
new file mode 100755
index 0000000..da4f15b
--- /dev/null
+++ b/fs/service_test.go
@@ -0,0 +1,39 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+// generated by github.com/apache/opendal-go-services
+
+package fs_test
+
+import (
+	"os"
+	"testing"
+
+	"github.com/stretchr/testify/require"
+	"github.com/apache/opendal-go-services/fs"
+)
+
+func TestScheme(t *testing.T) {
+	t.Parallel()
+	assert := require.New(t)
+
+	assert.Nil(fs.Scheme.LoadOnce())
+	path := fs.Scheme.Path()
+	assert.NotEmpty(path)
+	assert.Nil(os.Remove(path))
+}
+
diff --git a/gdrive/embed_linux_amd64.go b/gdrive/embed_linux_amd64.go
new file mode 100755
index 0000000..9ba0265
--- /dev/null
+++ b/gdrive/embed_linux_amd64.go
@@ -0,0 +1,25 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+// generated by github.com/apache/opendal-go-services
+
+package gdrive
+
+import _ "embed"
+
+//go:embed libopendal_c.linux.amd64.so.zst
+var libopendalZst []byte
diff --git a/gdrive/embed_linux_arm64.go b/gdrive/embed_linux_arm64.go
new file mode 100755
index 0000000..87d6186
--- /dev/null
+++ b/gdrive/embed_linux_arm64.go
@@ -0,0 +1,25 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+// generated by github.com/apache/opendal-go-services
+
+package gdrive
+
+import _ "embed"
+
+//go:embed libopendal_c.linux.arm64.so.zst
+var libopendalZst []byte
diff --git a/gdrive/go.mod b/gdrive/go.mod
new file mode 100755
index 0000000..b51f9d5
--- /dev/null
+++ b/gdrive/go.mod
@@ -0,0 +1,14 @@
+module github.com/apache/opendal-go-services/gdrive
+
+go 1.22.4
+
+require (
+	github.com/klauspost/compress v1.17.9
+	github.com/stretchr/testify v1.9.0
+)
+
+require (
+	github.com/davecgh/go-spew v1.1.1 // indirect
+	github.com/pmezard/go-difflib v1.0.0 // indirect
+	gopkg.in/yaml.v3 v3.0.1 // indirect
+)
diff --git a/gdrive/go.sum b/gdrive/go.sum
new file mode 100644
index 0000000..30739e7
--- /dev/null
+++ b/gdrive/go.sum
@@ -0,0 +1,12 @@
+github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
+github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA=
+github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw=
+github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
+github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
+github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
+github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
+gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
+gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
+gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
diff --git a/gdrive/libopendal_c.linux.amd64.so.zst b/gdrive/libopendal_c.linux.amd64.so.zst
new file mode 100644
index 0000000..180236b
Binary files /dev/null and b/gdrive/libopendal_c.linux.amd64.so.zst differ
diff --git a/gdrive/libopendal_c.linux.arm64.so.zst b/gdrive/libopendal_c.linux.arm64.so.zst
new file mode 100644
index 0000000..3a5b659
Binary files /dev/null and b/gdrive/libopendal_c.linux.arm64.so.zst differ
diff --git a/gdrive/service.go b/gdrive/service.go
new file mode 100755
index 0000000..8177ce5
--- /dev/null
+++ b/gdrive/service.go
@@ -0,0 +1,104 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+// generated by github.com/apache/opendal-go-services
+
+package gdrive
+
+import (
+	"bytes"
+	"fmt"
+	"io"
+	"os"
+	"sync"
+
+	"github.com/klauspost/compress/zstd"
+)
+
+var Scheme = scheme{once: &sync.Once{}}
+
+type scheme struct {
+	once *sync.Once
+}
+
+func (scheme) Name() string {
+	return "gdrive"
+}
+
+func (s scheme) Path() string {
+	return path
+}
+
+func (s scheme) LoadOnce() error {
+	var err error
+	s.once.Do(func() {
+		err = load()
+		if err != nil {
+			err = fmt.Errorf("opendal/services/gdrive: %s", err)
+		}
+	})
+	return err
+}
+
+var path string
+
+func load() error {
+	data, err := decompressLib(libopendalZst)
+	if err != nil {
+		return err
+	}
+	path, err = writeTempExec("libopendal_c*.so", data)
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+func writeTempExec(pattern string, binary []byte) (path string, err error) {
+	f, err := os.CreateTemp("", pattern)
+	if err != nil {
+		err = fmt.Errorf("cannot create temp file: %s", err)
+		return
+	}
+	defer f.Close()
+	_, err = f.Write(binary)
+	if err != nil {
+		err = fmt.Errorf("cannot write binary: %s", err)
+		return
+	}
+	err = f.Chmod(os.ModePerm)
+	if err != nil {
+		err = fmt.Errorf("cannot chmod: %s", err)
+		return
+	}
+	path = f.Name()
+	return
+}
+
+func decompressLib(raw []byte) (data []byte, err error) {
+	decoder, err := zstd.NewReader(bytes.NewReader(raw))
+	if err != nil {
+		err = fmt.Errorf("cannot create zstd reader: %s", err)
+		return
+	}
+	defer decoder.Close()
+	data, err = io.ReadAll(decoder)
+	if err != nil {
+		err = fmt.Errorf("cannot reading decompressed data: %s", err)
+	}
+	return
+}
diff --git a/gdrive/service_test.go b/gdrive/service_test.go
new file mode 100755
index 0000000..d8a8f8b
--- /dev/null
+++ b/gdrive/service_test.go
@@ -0,0 +1,39 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+// generated by github.com/apache/opendal-go-services
+
+package gdrive_test
+
+import (
+	"os"
+	"testing"
+
+	"github.com/stretchr/testify/require"
+	"github.com/apache/opendal-go-services/gdrive"
+)
+
+func TestScheme(t *testing.T) {
+	t.Parallel()
+	assert := require.New(t)
+
+	assert.Nil(gdrive.Scheme.LoadOnce())
+	path := gdrive.Scheme.Path()
+	assert.NotEmpty(path)
+	assert.Nil(os.Remove(path))
+}
+
diff --git a/memory/embed_linux_amd64.go b/memory/embed_linux_amd64.go
new file mode 100755
index 0000000..2576cde
--- /dev/null
+++ b/memory/embed_linux_amd64.go
@@ -0,0 +1,25 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+// generated by github.com/apache/opendal-go-services
+
+package memory
+
+import _ "embed"
+
+//go:embed libopendal_c.linux.amd64.so.zst
+var libopendalZst []byte
diff --git a/memory/embed_linux_arm64.go b/memory/embed_linux_arm64.go
new file mode 100755
index 0000000..5a73883
--- /dev/null
+++ b/memory/embed_linux_arm64.go
@@ -0,0 +1,25 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+// generated by github.com/apache/opendal-go-services
+
+package memory
+
+import _ "embed"
+
+//go:embed libopendal_c.linux.arm64.so.zst
+var libopendalZst []byte
diff --git a/memory/go.mod b/memory/go.mod
new file mode 100755
index 0000000..a3af456
--- /dev/null
+++ b/memory/go.mod
@@ -0,0 +1,14 @@
+module github.com/apache/opendal-go-services/memory
+
+go 1.22.4
+
+require (
+	github.com/klauspost/compress v1.17.9
+	github.com/stretchr/testify v1.9.0
+)
+
+require (
+	github.com/davecgh/go-spew v1.1.1 // indirect
+	github.com/pmezard/go-difflib v1.0.0 // indirect
+	gopkg.in/yaml.v3 v3.0.1 // indirect
+)
diff --git a/memory/go.sum b/memory/go.sum
new file mode 100644
index 0000000..30739e7
--- /dev/null
+++ b/memory/go.sum
@@ -0,0 +1,12 @@
+github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
+github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA=
+github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw=
+github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
+github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
+github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
+github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
+gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
+gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
+gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
diff --git a/memory/libopendal_c.linux.amd64.so.zst b/memory/libopendal_c.linux.amd64.so.zst
new file mode 100644
index 0000000..4df491f
Binary files /dev/null and b/memory/libopendal_c.linux.amd64.so.zst differ
diff --git a/memory/libopendal_c.linux.arm64.so.zst b/memory/libopendal_c.linux.arm64.so.zst
new file mode 100644
index 0000000..37f6e59
Binary files /dev/null and b/memory/libopendal_c.linux.arm64.so.zst differ
diff --git a/memory/service.go b/memory/service.go
new file mode 100755
index 0000000..05db73f
--- /dev/null
+++ b/memory/service.go
@@ -0,0 +1,104 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+// generated by github.com/apache/opendal-go-services
+
+package memory
+
+import (
+	"bytes"
+	"fmt"
+	"io"
+	"os"
+	"sync"
+
+	"github.com/klauspost/compress/zstd"
+)
+
+var Scheme = scheme{once: &sync.Once{}}
+
+type scheme struct {
+	once *sync.Once
+}
+
+func (scheme) Name() string {
+	return "memory"
+}
+
+func (s scheme) Path() string {
+	return path
+}
+
+func (s scheme) LoadOnce() error {
+	var err error
+	s.once.Do(func() {
+		err = load()
+		if err != nil {
+			err = fmt.Errorf("opendal/services/memory: %s", err)
+		}
+	})
+	return err
+}
+
+var path string
+
+func load() error {
+	data, err := decompressLib(libopendalZst)
+	if err != nil {
+		return err
+	}
+	path, err = writeTempExec("libopendal_c*.so", data)
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+func writeTempExec(pattern string, binary []byte) (path string, err error) {
+	f, err := os.CreateTemp("", pattern)
+	if err != nil {
+		err = fmt.Errorf("cannot create temp file: %s", err)
+		return
+	}
+	defer f.Close()
+	_, err = f.Write(binary)
+	if err != nil {
+		err = fmt.Errorf("cannot write binary: %s", err)
+		return
+	}
+	err = f.Chmod(os.ModePerm)
+	if err != nil {
+		err = fmt.Errorf("cannot chmod: %s", err)
+		return
+	}
+	path = f.Name()
+	return
+}
+
+func decompressLib(raw []byte) (data []byte, err error) {
+	decoder, err := zstd.NewReader(bytes.NewReader(raw))
+	if err != nil {
+		err = fmt.Errorf("cannot create zstd reader: %s", err)
+		return
+	}
+	defer decoder.Close()
+	data, err = io.ReadAll(decoder)
+	if err != nil {
+		err = fmt.Errorf("cannot reading decompressed data: %s", err)
+	}
+	return
+}
diff --git a/memory/service_test.go b/memory/service_test.go
new file mode 100755
index 0000000..7f87fd3
--- /dev/null
+++ b/memory/service_test.go
@@ -0,0 +1,39 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+// generated by github.com/apache/opendal-go-services
+
+package memory_test
+
+import (
+	"os"
+	"testing"
+
+	"github.com/stretchr/testify/require"
+	"github.com/apache/opendal-go-services/memory"
+)
+
+func TestScheme(t *testing.T) {
+	t.Parallel()
+	assert := require.New(t)
+
+	assert.Nil(memory.Scheme.LoadOnce())
+	path := memory.Scheme.Path()
+	assert.NotEmpty(path)
+	assert.Nil(os.Remove(path))
+}
+
diff --git a/s3/embed_linux_amd64.go b/s3/embed_linux_amd64.go
new file mode 100755
index 0000000..3a1884b
--- /dev/null
+++ b/s3/embed_linux_amd64.go
@@ -0,0 +1,25 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+// generated by github.com/apache/opendal-go-services
+
+package s3
+
+import _ "embed"
+
+//go:embed libopendal_c.linux.amd64.so.zst
+var libopendalZst []byte
diff --git a/s3/embed_linux_arm64.go b/s3/embed_linux_arm64.go
new file mode 100755
index 0000000..e891d68
--- /dev/null
+++ b/s3/embed_linux_arm64.go
@@ -0,0 +1,25 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+// generated by github.com/apache/opendal-go-services
+
+package s3
+
+import _ "embed"
+
+//go:embed libopendal_c.linux.arm64.so.zst
+var libopendalZst []byte
diff --git a/s3/go.mod b/s3/go.mod
new file mode 100755
index 0000000..3738619
--- /dev/null
+++ b/s3/go.mod
@@ -0,0 +1,14 @@
+module github.com/apache/opendal-go-services/s3
+
+go 1.22.4
+
+require (
+	github.com/klauspost/compress v1.17.9
+	github.com/stretchr/testify v1.9.0
+)
+
+require (
+	github.com/davecgh/go-spew v1.1.1 // indirect
+	github.com/pmezard/go-difflib v1.0.0 // indirect
+	gopkg.in/yaml.v3 v3.0.1 // indirect
+)
diff --git a/s3/go.sum b/s3/go.sum
new file mode 100644
index 0000000..30739e7
--- /dev/null
+++ b/s3/go.sum
@@ -0,0 +1,12 @@
+github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
+github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA=
+github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw=
+github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
+github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
+github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
+github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
+gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
+gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
+gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
diff --git a/s3/libopendal_c.linux.amd64.so.zst b/s3/libopendal_c.linux.amd64.so.zst
new file mode 100644
index 0000000..b922fb3
Binary files /dev/null and b/s3/libopendal_c.linux.amd64.so.zst differ
diff --git a/s3/libopendal_c.linux.arm64.so.zst b/s3/libopendal_c.linux.arm64.so.zst
new file mode 100644
index 0000000..6115f74
Binary files /dev/null and b/s3/libopendal_c.linux.arm64.so.zst differ
diff --git a/s3/service.go b/s3/service.go
new file mode 100755
index 0000000..9cf7a3f
--- /dev/null
+++ b/s3/service.go
@@ -0,0 +1,104 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+// generated by github.com/apache/opendal-go-services
+
+package s3
+
+import (
+	"bytes"
+	"fmt"
+	"io"
+	"os"
+	"sync"
+
+	"github.com/klauspost/compress/zstd"
+)
+
+var Scheme = scheme{once: &sync.Once{}}
+
+type scheme struct {
+	once *sync.Once
+}
+
+func (scheme) Name() string {
+	return "s3"
+}
+
+func (s scheme) Path() string {
+	return path
+}
+
+func (s scheme) LoadOnce() error {
+	var err error
+	s.once.Do(func() {
+		err = load()
+		if err != nil {
+			err = fmt.Errorf("opendal/services/s3: %s", err)
+		}
+	})
+	return err
+}
+
+var path string
+
+func load() error {
+	data, err := decompressLib(libopendalZst)
+	if err != nil {
+		return err
+	}
+	path, err = writeTempExec("libopendal_c*.so", data)
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+func writeTempExec(pattern string, binary []byte) (path string, err error) {
+	f, err := os.CreateTemp("", pattern)
+	if err != nil {
+		err = fmt.Errorf("cannot create temp file: %s", err)
+		return
+	}
+	defer f.Close()
+	_, err = f.Write(binary)
+	if err != nil {
+		err = fmt.Errorf("cannot write binary: %s", err)
+		return
+	}
+	err = f.Chmod(os.ModePerm)
+	if err != nil {
+		err = fmt.Errorf("cannot chmod: %s", err)
+		return
+	}
+	path = f.Name()
+	return
+}
+
+func decompressLib(raw []byte) (data []byte, err error) {
+	decoder, err := zstd.NewReader(bytes.NewReader(raw))
+	if err != nil {
+		err = fmt.Errorf("cannot create zstd reader: %s", err)
+		return
+	}
+	defer decoder.Close()
+	data, err = io.ReadAll(decoder)
+	if err != nil {
+		err = fmt.Errorf("cannot reading decompressed data: %s", err)
+	}
+	return
+}
diff --git a/s3/service_test.go b/s3/service_test.go
new file mode 100755
index 0000000..ac17ee8
--- /dev/null
+++ b/s3/service_test.go
@@ -0,0 +1,39 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+// generated by github.com/apache/opendal-go-services
+
+package s3_test
+
+import (
+	"os"
+	"testing"
+
+	"github.com/stretchr/testify/require"
+	"github.com/apache/opendal-go-services/s3"
+)
+
+func TestScheme(t *testing.T) {
+	t.Parallel()
+	assert := require.New(t)
+
+	assert.Nil(s3.Scheme.LoadOnce())
+	path := s3.Scheme.Path()
+	assert.NotEmpty(path)
+	assert.Nil(os.Remove(path))
+}
+