Categorygithub.com/pawelgaczynski/giouring
repositorypackage
0.0.0-20230826085535-69588b89acb9
Repository: https://github.com/pawelgaczynski/giouring.git
Documentation: pkg.go.dev

# Packages

No description provided by the author

# README

giouring - about the project

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.

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.

Important notice

  • 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.

Documentation

Go Reference

(back to top)

Used by

(back to top)

Prerequisites

Gain requires Go 1.20+

(back to top)

Implemented structs

liburing nameGolang liburing port nameNotesImplemented
io_uring_sqSubmissionQueue:heavy_check_mark:
io_uring_cqCompletionQueue:heavy_check_mark:
io_uringRing:heavy_check_mark:
io_uring_sqeSubmissionQueueEntry:heavy_check_mark:
io_uring_cqeCompletionQueueEvent:heavy_check_mark:
io_sqring_offsetsSQRingOffsets:heavy_check_mark:
io_cqring_offsetsCQRingOffsets:heavy_check_mark:
io_uring_paramsParams:heavy_check_mark:
io_uring_files_updateFilesUpdate:heavy_check_mark:
io_uring_rsrc_registerRsrcRegister:heavy_check_mark:
io_uring_rsrc_updateRsrcUpdate:heavy_check_mark:
io_uring_rsrc_update2RsrcUpdate2:heavy_check_mark:
io_uring_probe_opProbeOp:heavy_check_mark:
io_uring_probeProbe:heavy_check_mark:
io_uring_restrictionRestriction:heavy_check_mark:
io_uring_bufBufAndRing:heavy_check_mark:
io_uring_buf_ringBufAndRing:heavy_check_mark:
io_uring_buf_regBufReg:heavy_check_mark:
io_uring_getevents_argGetEventsArg:heavy_check_mark:
io_uring_sync_cancel_regSyncCancelReg:heavy_check_mark:
io_uring_file_index_rangeFileIndexRange:heavy_check_mark:
io_uring_recvmsg_outRecvmsgOut:heavy_check_mark:

(back to top)

Implemented methods

liburing nameReceiver typeGolang liburing port nameNotesImplemented
IO_URING_CHECK_VERSION
IO_URING_VERSION_MAJOR
IO_URING_VERSION_MINOR
io_uring_buf_ring_addBufAndRingBufRingAdd:heavy_check_mark:
io_uring_buf_ring_advanceBufAndRingBufRingAdvance:heavy_check_mark:
io_uring_buf_ring_cq_advanceRingBufRingCQAdvance:heavy_check_mark:
io_uring_buf_ring_initBufAndRingBufRingInit:heavy_check_mark:
io_uring_buf_ring_maskBufRingMask:heavy_check_mark:
io_uring_check_versionCheckVersion:heavy_check_mark:
io_uring_close_ring_fdRingCloseRingFd:heavy_check_mark:
io_uring_cq_advanceRingCQAdvance:heavy_check_mark:
io_uring_cq_has_overflowRingCQHasOverflow:heavy_check_mark:
io_uring_cq_readyRingCQReady:heavy_check_mark:
io_uring_cqe_get_dataCompletionQueueEventGetData:heavy_check_mark:
io_uring_cqe_get_data64CompletionQueueEventGetData64:heavy_check_mark:
io_uring_cqe_seenRingCQESeen:heavy_check_mark:
io_uring_enterRingEnter:heavy_check_mark:
io_uring_enter2RingEnter2:heavy_check_mark:
io_uring_for_each_cqeRingForEachCQE:heavy_check_mark:
io_uring_free_buf_ringRingFreeBufRing:heavy_check_mark:
io_uring_free_probe:heavy_exclamation_mark:unnecessary:heavy_multiplication_x:
io_uring_get_eventsRingGetEvents:heavy_check_mark:
io_uring_get_probeGetProbe:heavy_check_mark:
io_uring_get_probe_ringRingGetProbeRing:heavy_check_mark:
io_uring_get_sqeRingGetSQE:heavy_check_mark:
io_uring_major_versionMajorVersion:heavy_check_mark:
io_uring_minor_versionMinorVersion:heavy_check_mark:
io_uring_opcode_supportedProbeIsSupported:heavy_check_mark:
io_uring_peek_cqeRingPeekCQE:heavy_check_mark:
io_uring_prep_acceptSubmissionQueueEntryPrepareAccept:heavy_check_mark:
io_uring_prep_accept_directSubmissionQueueEntryPrepareAcceptDirect:heavy_check_mark:
io_uring_prep_cancelSubmissionQueueEntryPrepareCancel:heavy_check_mark:
io_uring_prep_cancel64SubmissionQueueEntryPrepareCancel64:heavy_check_mark:
io_uring_prep_closeSubmissionQueueEntryPrepareClose:heavy_check_mark:
io_uring_prep_close_directSubmissionQueueEntryPrepareCloseDirect:heavy_check_mark:
io_uring_prep_connectSubmissionQueueEntryPrepareConnect:heavy_check_mark:
io_uring_prep_fadviseSubmissionQueueEntryPrepareFadvise:heavy_check_mark:
io_uring_prep_fallocateSubmissionQueueEntryPrepareFallocate:heavy_check_mark:
io_uring_prep_fgetxattrSubmissionQueueEntryPrepareFgetxattr:heavy_check_mark:
io_uring_prep_files_updateSubmissionQueueEntryPrepareFilesUpdate:heavy_check_mark:
io_uring_prep_fsetxattrSubmissionQueueEntryPrepareFsetxattr:heavy_check_mark:
io_uring_prep_fsyncSubmissionQueueEntryPrepareFsync:heavy_check_mark:
io_uring_prep_getxattrSubmissionQueueEntryPrepareGetxattr:heavy_check_mark:
io_uring_prep_linkSubmissionQueueEntryPrepareLink:heavy_check_mark:
io_uring_prep_link_timeoutSubmissionQueueEntryPrepareLinkTimeout:heavy_check_mark:
io_uring_prep_linkatSubmissionQueueEntryPrepareLinkat:heavy_check_mark:
io_uring_prep_madviseSubmissionQueueEntryPrepareMadvise:heavy_check_mark:
io_uring_prep_mkdirSubmissionQueueEntryPrepareMkdir:heavy_check_mark:
io_uring_prep_mkdiratSubmissionQueueEntryPrepareMkdirat:heavy_check_mark:
io_uring_prep_msg_ringSubmissionQueueEntryPrepareMsgRing:heavy_check_mark:
io_uring_prep_msg_ring_cqe_flagsSubmissionQueueEntryPrepareMsgRingCqeFlags:heavy_check_mark:
io_uring_prep_msg_ring_fdSubmissionQueueEntryPrepareMsgRingFd:heavy_check_mark:
io_uring_prep_msg_ring_fd_allocSubmissionQueueEntryPrepareMsgRingFdAlloc:heavy_check_mark:
io_uring_prep_multishot_acceptSubmissionQueueEntryPrepareMultishotAccept:heavy_check_mark:
io_uring_prep_multishot_accept_directSubmissionQueueEntryPrepareMultishotAcceptDirect:heavy_check_mark:
io_uring_prep_nopSubmissionQueueEntryPrepareNop:heavy_check_mark:
io_uring_prep_openatSubmissionQueueEntryPrepareOpenat:heavy_check_mark:
io_uring_prep_openat2SubmissionQueueEntryPrepareOpenat2:heavy_check_mark:
io_uring_prep_openat2_directSubmissionQueueEntryPrepareOpenat2Direct:heavy_check_mark:
io_uring_prep_openat_directSubmissionQueueEntryPrepareOpenatDirect:heavy_check_mark:
io_uring_prep_poll_addSubmissionQueueEntryPreparePollAdd:heavy_check_mark:
io_uring_prep_poll_multishotSubmissionQueueEntryPreparePollMultishot:heavy_check_mark:
io_uring_prep_poll_removeSubmissionQueueEntryPreparePollRemove:heavy_check_mark:
io_uring_prep_poll_updateSubmissionQueueEntryPreparePollUpdate:heavy_check_mark:
io_uring_prep_provide_buffersSubmissionQueueEntryPrepareProvideBuffers:heavy_check_mark:
io_uring_prep_readSubmissionQueueEntryPrepareRead:heavy_check_mark:
io_uring_prep_read_fixedSubmissionQueueEntryPrepareReadFixed:heavy_check_mark:
io_uring_prep_readvSubmissionQueueEntryPrepareReadv:heavy_check_mark:
io_uring_prep_readv2SubmissionQueueEntryPrepareReadv2:heavy_check_mark:
io_uring_prep_recvSubmissionQueueEntryPrepareRecv:heavy_check_mark:
io_uring_prep_recv_multishotSubmissionQueueEntryPrepareRecvMultishot:heavy_check_mark:
io_uring_prep_recvmsgSubmissionQueueEntryPrepareRecvMsg:heavy_check_mark:
io_uring_prep_recvmsg_multishotSubmissionQueueEntryPrepareRecvMsgMultishot:heavy_check_mark:
io_uring_prep_remove_buffersSubmissionQueueEntryPrepareRemoveBuffers:heavy_check_mark:
io_uring_prep_renameSubmissionQueueEntryPrepareRename:heavy_check_mark:
io_uring_prep_renameatSubmissionQueueEntryPrepareRenameat:heavy_check_mark:
io_uring_prep_sendSubmissionQueueEntryPrepareSend:heavy_check_mark:
io_uring_prep_send_set_addrSubmissionQueueEntryPrepareSendSetAddr:heavy_check_mark:
io_uring_prep_send_zcSubmissionQueueEntryPrepareSendZC:heavy_check_mark:
io_uring_prep_send_zc_fixedSubmissionQueueEntryPrepareSendZCFixed:heavy_check_mark:
io_uring_prep_sendmsgSubmissionQueueEntryPrepareSendMsg:heavy_check_mark:
io_uring_prep_sendmsg_zcSubmissionQueueEntryPrepareSendmsgZC:heavy_check_mark:
io_uring_prep_sendtoSubmissionQueueEntryPrepareSendto:heavy_check_mark:
io_uring_prep_setxattrSubmissionQueueEntryPrepareSetxattr:heavy_check_mark:
io_uring_prep_shutdownSubmissionQueueEntryPrepareShutdown:heavy_check_mark:
io_uring_prep_socketSubmissionQueueEntryPrepareSocket:heavy_check_mark:
io_uring_prep_socket_directSubmissionQueueEntryPrepareSocketDirect:heavy_check_mark:
io_uring_prep_socket_direct_allocSubmissionQueueEntryPrepareSocketDirectAlloc:heavy_check_mark:
io_uring_prep_spliceSubmissionQueueEntryPrepareSplice:heavy_check_mark:
io_uring_prep_statxSubmissionQueueEntryPrepareStatx:heavy_check_mark:
io_uring_prep_symlinkSubmissionQueueEntryPrepareSymlink:heavy_check_mark:
io_uring_prep_symlinkatSubmissionQueueEntryPrepareSymlinkat:heavy_check_mark:
io_uring_prep_sync_file_rangeSubmissionQueueEntryPrepareSyncFileRange:heavy_check_mark:
io_uring_prep_teeSubmissionQueueEntryPrepareTee:heavy_check_mark:
io_uring_prep_timeoutSubmissionQueueEntryPrepareTimeout:heavy_check_mark:
io_uring_prep_timeout_removeSubmissionQueueEntryPrepareTimeoutRemove:heavy_check_mark:
io_uring_prep_timeout_updateSubmissionQueueEntryPrepareTimeoutUpdate:heavy_check_mark:
io_uring_prep_unlinkSubmissionQueueEntryPrepareUnlink:heavy_check_mark:
io_uring_prep_unlinkatSubmissionQueueEntryPrepareUnlinkat:heavy_check_mark:
io_uring_prep_writeSubmissionQueueEntryPrepareWrite:heavy_check_mark:
io_uring_prep_write_fixedSubmissionQueueEntryPrepareWriteFixed:heavy_check_mark:
io_uring_prep_writevSubmissionQueueEntryPrepareWritev:heavy_check_mark:
io_uring_prep_writev2SubmissionQueueEntryPrepareWritev2:heavy_check_mark:
io_uring_queue_exitRingQueueExit:heavy_check_mark:
io_uring_queue_initRingQueueInit:heavy_check_mark:
io_uring_queue_init_paramsRingQueueInitParams:heavy_check_mark:
io_uring_recvmsg_cmsg_firsthdrRecvmsgOutCmsgFirsthdr:heavy_check_mark:
io_uring_recvmsg_cmsg_nexthdrRecvmsgOutCmsgNexthdr:heavy_check_mark:
io_uring_recvmsg_nameRecvmsgOutName:heavy_check_mark:
io_uring_recvmsg_payloadRecvmsgOutPayload:heavy_check_mark:
io_uring_recvmsg_payload_lengthRecvmsgOutPayloadLength:heavy_check_mark:
io_uring_recvmsg_validateRecvmsgOutRecvmsgValidate:heavy_check_mark:
io_uring_registerRingRegister:heavy_check_mark:
io_uring_register_buf_ringRingRegisterBufferRing:heavy_check_mark:
io_uring_register_buffersRingRegisterBuffers:heavy_check_mark:
io_uring_register_buffers_sparseRingRegisterBuffersSparse:heavy_check_mark:
io_uring_register_buffers_tagsRingRegisterBuffersTags:heavy_check_mark:
io_uring_register_buffers_update_tagRingRegisterBuffersUpdateTag:heavy_check_mark:
io_uring_register_eventfdRingRegisterEventFd:heavy_check_mark:
io_uring_register_eventfd_asyncRingRegisterEventFdAsync:heavy_check_mark:
io_uring_register_file_alloc_rangeRingRegisterFileAllocRange:heavy_check_mark:
io_uring_register_filesRingRegisterFiles:heavy_check_mark:
io_uring_register_files_sparseRingRegisterFilesSparse:heavy_check_mark:
io_uring_register_files_tagsRingRegisterFilesTags:heavy_check_mark:
io_uring_register_files_updateRingRegisterFilesUpdate:heavy_check_mark:
io_uring_register_files_update_tagRingRegisterFilesUpdateTag:heavy_check_mark:
io_uring_register_iowq_affRingRegisterIOWQAff:heavy_check_mark:
io_uring_register_iowq_max_workersRingRegisterIOWQMaxWorkers:heavy_check_mark:
io_uring_register_ring_fdRingRegisterRingFd:heavy_check_mark:
io_uring_register_sync_cancelRingRegisterSyncCancel:heavy_check_mark:
io_uring_setupSetup:heavy_check_mark:
io_uring_setup_buf_ringRingSetupBufRing:heavy_check_mark:
io_uring_sq_readyRingSQReady:heavy_check_mark:
io_uring_sq_space_leftRingSQSpaceLeft:heavy_check_mark:
io_uring_sqe_set_dataSubmissionQueueEntrySetData:heavy_check_mark:
io_uring_sqe_set_data64SubmissionQueueEntrySetData64:heavy_check_mark:
io_uring_sqe_set_flagsSubmissionQueueEntrySetFlags:heavy_check_mark:
io_uring_sqring_waitRingSQRingWait:heavy_check_mark:
io_uring_submitRingSubmit:heavy_check_mark:
io_uring_submit_and_get_eventsRingSubmitAndGetEvents:heavy_check_mark:
io_uring_submit_and_waitRingSubmitAndWait:heavy_check_mark:
io_uring_submit_and_wait_timeoutRingSubmitAndWaitTimeout:heavy_check_mark:
io_uring_unregister_buf_ringRingUnregisterBufferRing:heavy_check_mark:
io_uring_unregister_buffersRingUnregisterBuffers:heavy_check_mark:
io_uring_unregister_eventfdRingUnregisterEventFd:heavy_check_mark:
io_uring_unregister_filesRingUnregisterFiles:heavy_check_mark:
io_uring_unregister_iowq_affRingUnregisterIOWQAff:heavy_check_mark:
io_uring_unregister_ring_fdRingUnregisterRingFd:heavy_check_mark:
io_uring_wait_cqeRingWaitCQE:heavy_check_mark:
io_uring_wait_cqe_nrRingWaitCQENr:heavy_check_mark:
io_uring_wait_cqe_timeoutRingWaitCQETimeout:heavy_check_mark:
io_uring_wait_cqesRingWaitCQEs:heavy_check_mark:

(back to top)

License

Distributed under the MIT License. See LICENSE for more information.

(back to top)

Contact

Paweł Gaczyński - LinkedIn

(back to top)

Contributing

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!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)