Skip to content

neurodrone/picard

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 

picard

Picard is a Go client for Sheepdog.

Usage

  // Create a new Picard connection to Sheepdog cluster
  // using the host:port string.
  c, err := picard.NewCluster(hostport)
  if err != nil {
    return err
  }

  // Always make sure to cleanly exit.
  defer c.Disconnect()

  // Open an existing VDI image for reading or writing
  vdi, err := c.OpenVDI("WoolWag")
  if err != nil {
    return err
  }
  defer vdi.Close()

  // Write some bytes onto the VDI.
  if _, err := vdi.Write(someBytes); err != nil {
    return err
  }

  // Read information off of VDI.
  buf := make([]byte, 100)
  if _, err := vdi.Read(buf); err != nil {
    return err
  }

  // Do something with the `buf` here.

Tests

Picard uses the typical way of running Go tests.

$ go test -tags integration -v
=== RUN TestVDIRun
--- PASS: TestVDIRun (9.99s)
PASS
coverage: 88.6% of statements
ok  github.com/neurodrone/picard 10.002s

About

A sheepdog client in Go.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages