goseaweedfs
A complete Golang client for SeaweedFS. Inspired by:
This fork
Add buffer pool support when uploading in multipart-format, which will pre-allocate and re-use memory and reduce memory usage significantly if the size of uploading file can be estimated.
How to use the pool
go get -u github.com/darkdarkfruit/goseaweedfs
# If the PR is accepted(Not yet), then do:
# go get -u github.com/linxGnu/goseaweedfs
Just call
// make a client
weed := goseaweedfs.NewSeaweed(c.MasterScheme, c.MasterAddr, nil, 4*1024*1024, time.Minute)
// then set the pool, eg: bufferLen: 0, bufferCap: 32M
weed.Client.Client.InitBufferPool(0, 32*1024*1024)
// ---
// or one call
weed := goseaweedfs.NewSeaweedWithBufferPoolSupport(c.MasterScheme, c.MasterAddr, nil, 4*1024*1024, time.Minute, 0, 32*1024*1024)
Installation
go get -u github.com/linxGnu/goseaweedfs
Usage
Please refer to Test Cases for sample code.
Supported
- Grow
- Status
- Cluster Status
- Filer
- Upload
- Submit
- Delete
- Replace
- Upload large file with builtin manifest handler, auto file split and chunking
- Admin Operations (mount, unmount, delete volumn, etc)
Contributing
Please issue me for things gone wrong or:
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D