Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/fishman/go-freenas

Golang FreeNAS api client
https://github.com/fishman/go-freenas

freenas go

Last synced: 2 months ago
JSON representation

Golang FreeNAS api client

Awesome Lists containing this project

README

        

# go-freenas

[![Build Status](https://travis-ci.org/fishman/go-freenas.svg?branch=master)](https://travis-ci.org/fishman/go-freenas)

go-freenas is a Go client library for accessing the [FreeNAS API](http://api.freenas.org).

## Usage ##

```go
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:

```go
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