A pure Go interface for interacting with libvirt using its RPC protocol instead of C bindings.
DigitalOcean/go-libvirt is a pure Go library that provides a native interface for managing virtual machines and hypervisors through libvirt's RPC protocol. It enables both local and remote connections to libvirt servers without requiring C bindings, using XDR encoding for RPC packets. The project automatically generates Go bindings from libvirt source code to maintain compatibility across libvirt versions.
Go developers building applications that need to programmatically manage virtual machines or hypervisors via libvirt, such as cloud infrastructure tools, virtualization management platforms, or DevOps automation scripts. It is particularly suited for those who prefer a pure Go solution without C dependencies.
Developers choose go-libvirt over alternatives because it offers a pure Go implementation that eliminates the complexity and distribution challenges of C bindings, while providing comprehensive API coverage through automated code generation that stays in sync with libvirt updates. Its support for both local and remote connections, including TLS, makes it versatile for various deployment scenarios.
Package libvirt provides a pure Go interface for interacting with Libvirt. Apache 2.0 Licensed.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Eliminates C dependency issues, making it easier to build and distribute Go applications that interact with libvirt, as stated in the README's emphasis on 'pure Go interface' and no C bindings.
Uses code generators to create Go bindings from libvirt source, ensuring compatibility with new libvirt versions, though manual regeneration is required, as described in the 'Running the Code Generators' section.
Provides Go equivalents for most libvirt functions by transforming names from the libvirt API reference, offering extensive RPC interface support, with examples like DomainShutdown mirroring virDomainShutdown.
Includes TLS support for secure TCP connections to remote libvirt servers, with detailed example code provided for setting up encrypted connections using dialers.
Requires downloading libvirt sources and running configure steps to regenerate bindings, which is complex and not integrated into the build process, as outlined in the 'Running the Code Generators' section.
The library warns that the API is not stable, leading to potential breaking changes and necessitating vendoring for projects, as mentioned in the 'Warning' section of the README.
Admits to possible subtle bugs that could cause unexpected behavior, as it's still under development and not fully mature, highlighted in the 'Warning' about use at your own risk.