darkdarkfruit / goseaweedfs

A complete Golang client for SeaweedFS

Home Page:https://github.com/chrislusf/seaweedfs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

goseaweedfs

Build Status Go Report Card Coverage Status godoc license

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:

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

About

A complete Golang client for SeaweedFS

https://github.com/chrislusf/seaweedfs

License:MIT License


Languages

Language:Go 100.0%