Skip to content

chango/goddfs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

goddfs

goddfs is a Go API for Disco DDFS. Requires https://github.com/hydrogen18/stalecucumber.

WARNING: This is still under development and is subject to change.

GODOC: https://godoc.org/github.com/chango/goddfs

Usage

go get github.com/chango/goddfs
go get github.com/hydrogen18/stalecucumber
import "github.com/chango/goddfs"
import "time"
import "fmt"
...
var err error
timeout := time.Second * 100
ddfs := goddfs.NewDDFSClient("localhost", "8989", timeout)

// Set tag attribute
err = ddfs.SetTagAttr("test:tag", "test", "test attribute")
if err != nil {
    fmt.Printf("Failed to set tag attr: %s\n", err)
}

// Get tag attributes
attrs, _ := ddfs.GetTagAttrs("test:tag")
for k, v := range attrs {
    fmt.Printf("ATTR: %s\tVAL: %s\n", k, v)
}

// Get single tag attribute
aaa, _ := ddfs.GetTagAttr("test:tag", "test")
fmt.Println(aaa)

// Delete tag attribute
err = ddfs.DelTagAttr("test:tag", "test") 
if err != nil {
    fmt.Printf("Failed to del attr: %s\n", err)
}

// Create the tag operation config (delayed bool, update bool)
tconf := goddfs.NewTagConfig(true, false)

// Chunk to DDFS (tag, path_to_file, chunk_size, tag_config)
urls, err := ddfs.Chunk("test:tag", []string{"/tmp/fileofstuff"}, 1048576, tconf)
if err != nil {
    fmt.Printf("Failed to chunk: %s\n", err)
}

fmt.Println("Chunked to: ", urls)

// Tag chunked blobs to another tag
ddfs.Tag("test:tag2", urls, tconf)

About

Go DDFS Client

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages