mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
add documentation about sorting, change the argument name from sorting to sorted
This commit is contained in:
parent
1a7b3e8e08
commit
38489bd846
@ -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])
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user