https://github.com/yaon-c2h8n2/go-glusterfs
A fast glusterfs-server CLI wrapper for Go.
https://github.com/yaon-c2h8n2/go-glusterfs
glusterfs go wrapper-api
Last synced: about 1 year ago
JSON representation
A fast glusterfs-server CLI wrapper for Go.
- Host: GitHub
- URL: https://github.com/yaon-c2h8n2/go-glusterfs
- Owner: Yaon-C2H8N2
- Created: 2024-05-19T19:25:24.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-24T19:53:20.000Z (almost 2 years ago)
- Last Synced: 2024-07-11T11:28:45.131Z (almost 2 years ago)
- Topics: glusterfs, go, wrapper-api
- Language: Go
- Homepage:
- Size: 16.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# go-glusterfs
A Go library for deploying and managing GlusterFS clusters. Implemented as a wrapper around the GlusterFS CLI.
## Disclaimer
This project is in early stages of development. It's a simple side-project I'm doing on my own to manage my
GlusterFS deployed on my homelab with a WebUI. It is not recommended for production use. Any feedback and contributions are more than
welcome.
## Features
- [x] Probe GlusterFS nodes
- [x] Create and delete volumes
- [x] Start and stop volumes
- [x] Event listener for volume and peer changes
## Example
```go
package main
import (
"go-glusterfs.yaon.fr/pkg/brick"
"go-glusterfs.yaon.fr/pkg/peer"
"go-glusterfs.yaon.fr/pkg/volume"
)
func main() {
//Probing nodes 2 and 3
hostnameList := []string{"node2", "node3"}
for _, hostname := range hostnameList {
err := peer.PeerProbe(hostname)
if err != nil {
panic(err)
}
}
//Creating bricks for each nodes in the pool
peers, err := peer.ListPeers()
var bricks []brick.Brick
if err != nil {
panic(err)
}
for _, p := range peers {
bricks = append(bricks, brick.Brick{
Peer: p,
Path: "/data/brick1",
})
}
//Creating a volume with the bricks
v, err := volume.CreateVolume("test-volume", bricks)
if err != nil {
panic(err)
}
err = v.Start()
if err != nil {
panic(err)
}
}
```