# 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)
}
# Functions
Debug enables debug logging for a Client.
Dial dials a connection to an OVSDB server and returns a Client.
EchoInterval specifies an interval at which the Client will send echo RPCs to an OVSDB server to keep the connection alive.
Equal creates a Cond that ensures a column's value equals the specified value.
New wraps an existing connection to an OVSDB server and returns a Client.
# Structs
A Client is an OVSDB client.
ClientStats contains statistics about a Client.
A Cond is a conditional expression which is evaluated by the OVSDB server in a transaction.
An Error is an error returned by an OVSDB server.
Select is a TransactOp which fetches information from a database.
# Interfaces
A TransactOp is an operation that can be applied with Client.Transact.