giouring is a Go port of the liburing library. It is written entirely in Go. No cgo.
Almost all functions and structures from liburing was implemented.
- giouring versioning is aligned with liburing versioning.
- giouring is currently up to date with liburing commit: e1e758ae8360521334399c2a6eace05fa518e218
The giouring API is very similar to the liburing API, so anyone familiar with liburing will find it easier when writing code. Significant changes include:
- Method and structure names have been aligned with the naming conventions of the Go language.
- The prefix io_uring has been removed from method and structure names. After importing the package, methods and types will be preceded by the library name: giouring.
- SQE and CQE types have been given full names: SubmissionQueueEntry and CompletionQueueEvent.
- Additionally, if a method primarily pertains to a specific structure, for example, all methods prefixed with io_uring_prep that are related to the SubmissionQueueEntry structure (in liburing: io_uring_sqe), the pointer that was passed in C as a method argument has been moved to the method receiver.
- giouring was tested on kernel version 6.2.0-27-generic. Keep in mind that when running unit tests on older kernel versions, some tests may fail because the older kernel may not support some functionality. This will be fixed in the future.
- Test coverage is currently low, but it will be systematically expanded.
Gain requires Go 1.20+
liburing name | Golang liburing port name | Notes | Implemented |
---|---|---|---|
io_uring_sq | SubmissionQueue | ✔️ | |
io_uring_cq | CompletionQueue | ✔️ | |
io_uring | Ring | ✔️ | |
io_uring_sqe | SubmissionQueueEntry | ✔️ | |
io_uring_cqe | CompletionQueueEvent | ✔️ | |
io_sqring_offsets | SQRingOffsets | ✔️ | |
io_cqring_offsets | CQRingOffsets | ✔️ | |
io_uring_params | Params | ✔️ | |
io_uring_files_update | FilesUpdate | ✔️ | |
io_uring_rsrc_register | RsrcRegister | ✔️ | |
io_uring_rsrc_update | RsrcUpdate | ✔️ | |
io_uring_rsrc_update2 | RsrcUpdate2 | ✔️ | |
io_uring_probe_op | ProbeOp | ✔️ | |
io_uring_probe | Probe | ✔️ | |
io_uring_restriction | Restriction | ✔️ | |
io_uring_buf | BufAndRing | ✔️ | |
io_uring_buf_ring | BufAndRing | ✔️ | |
io_uring_buf_reg | BufReg | ✔️ | |
io_uring_getevents_arg | GetEventsArg | ✔️ | |
io_uring_sync_cancel_reg | SyncCancelReg | ✔️ | |
io_uring_file_index_range | FileIndexRange | ✔️ | |
io_uring_recvmsg_out | RecvmsgOut | ✔️ |
Distributed under the MIT License. See LICENSE
for more information.
Paweł Gaczyński - LinkedIn
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request