Skip to content
go-billy-gluster
Go Shell Makefile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
.test_setup.sh
.travis.yml
CONTRIBUTING.md
Gopkg.testing
LICENSE
MAINTAINERS
Makefile
README.md
file.go
filesystem.go
filesystem_test.go

README.md

go-billy-gluster GoDoc Build Status codecov.io

This package provides a basic go-billy driver to access gluster volumes. It uses libgfapi so it's not needed to mount the volume locally.

So far, following actions are implemented:

  • Create
  • Open
  • OpenFile
  • Stat
  • Rename
  • Remove
  • Readdir
  • MkdirAll

For more information head to the documentation

Installation

This package requires native libgfapi library that is contained in the development client packages of gluster.

  • Arch / Manjaro:
pacman -S glusterfs
  • Ubuntu / Debian:
apt-get install glusterfs-common
  • CentOS / RHEL:
yum install glusterfs-api

After installing the dependency you can install the library with go get:

go get gopkg.in/src-d/go-billy-gluster.v0

Example of utilization

package main

import (
	"fmt"

	"gopkg.in/src-d/go-billy-gluster.v0"
)

func main() {
	fs, err := gluster.New("server", "volume")
	if err != nil {
		panic(fmt.Sprintf("cannot connect to gluster volume %s", err))
	}

	f, err := fs.Create("filename.ext")
	if err != nil {
		panic(fmt.Sprintf("cannot create file %s", err))
	}

	_, err = f.Write([]byte("text"))
	if err != nil {
		panic(fmt.Sprintf("cannot write to file %s", err))
	}

	err = f.Close()
	if err != nil {
		panic(fmt.Sprintf("cannot close file %s", err))
	}

	err = fs.Close()
	if err != nil {
		panic(fmt.Sprintf("cannot disconnect from volume %s", err))
	}
}

Contribute

Contributions are more than welcome, if you are interested please take a look to our Contributing Guidelines.

Code of Conduct

All activities under source{d} projects are governed by the source{d} code of conduct.

License

Apache License Version 2.0, see LICENSE.

You can’t perform that action at this time.