go-freenas is a Go client library for accessing the FreeNAS API.
import "github.com/fishman/go-freenas/freenas"
Construct a new FreeNAS client, then use the various services on the client to access different parts of the FreeNAS API. For example:
package main
import (
"context"
"fmt"
"github.com/fishman/go-freenas/freenas"
)
func main() {
client := freenas.NewClient("http://freenas.local", "root", "freenas")
// Turn on debugging
client.Debug(true)
shares, _, _ := client.NfsShares.List(context.Background())
for _, element := range shares {
fmt.Println(element.ID, element.Paths)
}
}
- google go-github client