Below is a template code for a LIBDNF5 plugin. For the complete tutorial on writing LIBDNF5 plugins, refer to libdnf5 plugins tutorial
.
libdnf5-plugins/template/template.cpp
libdnf5-plugin/template.cpp
libdnf5-plugins/template/CMakeLists.txt
libdnf5-plugin/CMakeLists.txt
libdnf5-plugins/template/template.conf
libdnf5-plugin/template.conf