tree: f76ec2eb6f24105cde1bf24cdd661ca88c2a63ad
  1. examples/
  2. tests/
  3. .gitignore
  4. CONTRIBUTING.md
  5. copier.go
  6. copy.go
  7. delete.go
  8. DEPENDENCIES.md
  9. DEPENDENCIES.rust.tsv
  10. error.go
  11. ffi.go
  12. go.mod
  13. go.sum
  14. layer.go
  15. lister.go
  16. Makefile
  17. metadata.go
  18. opendal.go
  19. operator.go
  20. operator_info.go
  21. presign.go
  22. reader.go
  23. README.md
  24. stat.go
  25. string.go
  26. string_ownership_test.go
  27. types.go
  28. util_unix.go
  29. util_windows.go
  30. writer.go
bindings/go/README.md

Apache OpenDAL™ Go Binding

Go Reference

opendal-go is a Native Go binding for Apache OpenDAL. It is built on top of opendal-c without CGO enabled, using purego and libffi.

We release the OpenDAL Go binding independently of the opendal crate (Rust core). For updates and compatibility, use the Go binding version instead of the opendal crate version.

Useful Links

Installation

opendal-go requires libffi to be installed.

go get github.com/apache/opendal/bindings/go@latest

Each service is a separate companion module. Add the schemes you use, for example the in-memory service:

go get github.com/apache/opendal-go-services/memory

Quickstart

package main

import (
	"fmt"
	"log"

	"github.com/apache/opendal-go-services/memory"
	opendal "github.com/apache/opendal/bindings/go"
)

func main() {
	op, err := opendal.NewOperator(memory.Scheme, opendal.OperatorOptions{})
	if err != nil {
		log.Fatal(err)
	}
	defer op.Close()

	if err := op.Write("hello.txt", []byte("Hello, OpenDAL!")); err != nil {
		log.Fatal(err)
	}

	data, err := op.Read("hello.txt")
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("Read content: %s\n", data)
}

For the full guide — connecting to real backends, streaming, listing, presigning, retries, and error handling — see the user guide.

Contributing

This document is for users of the binding. If you want to build the binding from source, run the tests, or run benchmarks, see CONTRIBUTING.md. Contributions are welcome; please also read the project-wide contributing guide.

License and Trademarks

Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0

Apache OpenDAL, OpenDAL, and Apache are either registered trademarks or trademarks of the Apache Software Foundation.