digitalocean/go-nbd v0.2.0
digitalocean/go-nbd
Captured source
source ↗v0.2.0
Repository: digitalocean/go-nbd
Tag: v0.2.0
Published: 2025-02-21T01:07:22Z
Prerelease: no
Release notes:
What's Changed
go-nbd, now with TLS!
The previous release was mistaken in suggesting that callers could dial over TLS by supplying an nbds-based URI and a tls.Config to the nbd.Dialer. That field has been deprecated.
Funnily enough, this does constitute a breaking behavioral change in that code that previously tried to use TLS with the nbd.Dialer will no longer vacuously fail 100% of the time during the handshake.
TLS Tutorial
As usual, put together an NBD URI and dial it with the nbd.Dialer:
uri := nbd.MustURI("nbds+unix://?socket=/var/run/test-nbd.sock")
var dialer nbd.Dialer
conn, err := dialer.Dial(context.TODO(), uri)
if err != nil {
return fmt.Errorf("nbd dial: %w", err)
}
defer conn.Close()Do the usual handshake to begin options negotiation:
err = conn.Connect()
if err != nil {
return fmt.Errorf("nbd connect: %w", err)
}
defer conn.Abort()Finally, upgrade to TLS before negotiating any other options:
err = conn.StartTLS(tlsConf)
if err != nil {
return fmt.Errorf("start tls: %w", err)
}That's it!
Full Changelog: https://github.com/digitalocean/go-nbd/compare/v0.1.0...v0.2.0
Notability
notability 2.0/10Routine library release, not AI