Skip to content

Latest commit

 

History

History
40 lines (28 loc) · 852 Bytes

README.md

File metadata and controls

40 lines (28 loc) · 852 Bytes

go-freenas

Build Status

go-freenas is a Go client library for accessing the FreeNAS API.

Usage

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)
  }

}

Ref

  • google go-github client