package
0.0.0-20221011132743-e2842369e2ef
Repository: https://github.com/sudhiaithal/go-openvswitch.git
Documentation: pkg.go.dev

# README

ovsdb

Package ovsdb implements an OVSDB client, as described in RFC 7047.

Package ovsdb allows you to communicate with an instance of ovsdb-server using the OVSDB protocol.

// Dial an OVSDB connection and create a *ovsdb.Client.
c, err := ovsdb.Dial("unix", "/var/run/openvswitch/db.sock")
if err != nil {
	log.Fatalf("failed to dial: %v", err)
}
// Be sure to close the connection!
defer c.Close()

// Ask ovsdb-server for all of its databases, but only allow the RPC
// a limited amount of time to complete before timing out.
ctx, cancel := context.WithTimeout(context.Background(), 2 * time.Second)
defer cancel()

dbs, err := c.ListDatabases(ctx)
if err != nil {
	log.Fatalf("failed to list databases: %v", err)
}

for _, d := range dbs {
	log.Println(d)
}