import ( "github.com/ha/doozer" "github.com/ha/doozer/alt" ) func main() { conn, err := doozer.Dial("localhost:8046") if err != nil { // handle error } defer conn.Close() // Use the connection to get a value from Doozer. value, _, err := conn.Get("/path/to/key", nil) if err != nil { // handle error } fmt.Printf("Value=%s\n", value) }
import ( "github.com/ha/doozer" "github.com/ha/doozer/alt" ) func main() { conn, err := doozer.Dial("localhost:8046") if err != nil { // handle error } defer conn.Close() // Use the connection to create a transaction. txn := conn.Begin() defer txn.Cancel() // Modify the value associated with a key. txn.Set("/path/to/key", []byte("new value"), -1) // Commit the transaction. _, err = txn.Commit() if err != nil { // handle error } }In this example, we connect to a Doozer server running at `localhost:8046` and create a transaction to modify the value associated with the key `/path/to/key`. We then commit the transaction. Overall, the github.com.ha.doozer Conn library provides a great set of functions and utilities when it comes to working with Doozer distributed database systems.