add documentation about sorting, change the argument name from sorting to sorted

release-0.4
evan-gu 2013-09-08 21:21:57 -04:00
parent 1a7b3e8e08
commit 38489bd846
2 changed files with 4 additions and 3 deletions

View File

@ -23,12 +23,13 @@ Besides the file and directory difference, all nodes have common attributes and
The path of access control list of the node.
### Operation:
- **Get** (path, recursive)
- **Get** (path, recursive, sorted)
Get the content of the node
- If the node is a file, the data of the file will be returned.
- If the node is a directory, the child nodes of the directory will be returned.
- If recursive is true, it will recursively get the nodes of the directory.
- If sorted is true, the result will be sorted based on the path.
- **Create** (path, value[optional], ttl [optional])

View File

@ -26,7 +26,7 @@ func New() *FileSystem {
}
func (fs *FileSystem) Get(nodePath string, recusive, sorting bool, index uint64, term uint64) (*Event, error) {
func (fs *FileSystem) Get(nodePath string, recusive, sorted bool, index uint64, term uint64) (*Event, error) {
n, err := fs.InternalGet(nodePath, index, term)
if err != nil {
@ -58,7 +58,7 @@ func (fs *FileSystem) Get(nodePath string, recusive, sorting bool, index uint64,
// eliminate hidden nodes
e.KVPairs = e.KVPairs[:i]
if sorting {
if sorted {
sort.Sort(e)
}
} else { // node is file