Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-datastore
Commits
4f1b920d
Commit
4f1b920d
authored
Nov 10, 2016
by
Jakub Sztandera
Committed by
GitHub
Nov 10, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #50 from polezaivsani/doc/fix-comments
Fix typos and stale comments
parents
49cdb3a5
1b69d39b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
13 deletions
+13
-13
datastore.go
datastore.go
+4
-4
key.go
key.go
+9
-9
No files found.
datastore.go
View file @
4f1b920d
...
...
@@ -60,11 +60,11 @@ type Datastore interface {
// result, _ := ds.Query(q)
//
// // use the channel interface; result may come in at different times
// for entry := range result.
Entries
() { ... }
// for entry := range result.
Next
() { ... }
//
//
// or wait for the query to be completely done
// result.
Wai
t()
//
result.AllEntries()
//
// or wait for the query to be completely done
//
entries, _ :=
result.
Res
t()
//
for entry := range entries { ... }
//
Query
(
q
query
.
Query
)
(
query
.
Results
,
error
)
}
...
...
key.go
View file @
4f1b920d
...
...
@@ -107,8 +107,8 @@ func (k Key) Reverse() Key {
}
// Namespaces returns the `namespaces` making up this Key.
// NewKey("/Comedy/MontyPython/Actor:JohnCleese").
List
()
// ["Comedy", "MontyPython
g
", "Actor:JohnCleese"]
// NewKey("/Comedy/MontyPython/Actor:JohnCleese").
Namespaces
()
// ["Comedy", "MontyPython", "Actor:JohnCleese"]
func
(
k
Key
)
Namespaces
()
[]
string
{
return
k
.
List
()
}
...
...
@@ -122,22 +122,22 @@ func (k Key) BaseNamespace() string {
}
// Type returns the "type" of this key (value of last namespace).
// NewKey("/Comedy/MontyPython/Actor:JohnCleese").
List
()
// NewKey("/Comedy/MontyPython/Actor:JohnCleese").
Type
()
// "Actor"
func
(
k
Key
)
Type
()
string
{
return
NamespaceType
(
k
.
BaseNamespace
())
}
// Name returns the "name" of this key (field of last namespace).
// NewKey("/Comedy/MontyPython/Actor:JohnCleese").
List
()
// "
Actor
"
// NewKey("/Comedy/MontyPython/Actor:JohnCleese").
Name
()
// "
JohnCleese
"
func
(
k
Key
)
Name
()
string
{
return
NamespaceValue
(
k
.
BaseNamespace
())
}
// Instance returns an "instance" of this type key (appends value to namespace).
// NewKey("/Comedy/MontyPython/Actor
:
JohnCle
e
se")
.List()
//
"
JohnCleese"
// NewKey("/Comedy/MontyPython/Actor
").Instance("
JohnCle
s
se")
//
NewKey("/Comedy/MontyPython/Actor:
JohnCleese"
)
func
(
k
Key
)
Instance
(
s
string
)
Key
{
return
NewKey
(
k
.
string
+
":"
+
s
)
}
...
...
@@ -162,14 +162,14 @@ func (k Key) Parent() Key {
}
// Child returns the `child` Key of this Key.
// NewKey("/Comedy/MontyPython").Child("Actor:JohnCleese")
// NewKey("/Comedy/MontyPython").Child(
NewKey(
"Actor:JohnCleese")
)
// NewKey("/Comedy/MontyPython/Actor:JohnCleese")
func
(
k
Key
)
Child
(
k2
Key
)
Key
{
return
NewKey
(
k
.
string
+
"/"
+
k2
.
string
)
}
// ChildString returns the `child` Key of this Key -- string helper.
// NewKey("/Comedy/MontyPython").Child("Actor:JohnCleese")
// NewKey("/Comedy/MontyPython").Child
String
("Actor:JohnCleese")
// NewKey("/Comedy/MontyPython/Actor:JohnCleese")
func
(
k
Key
)
ChildString
(
s
string
)
Key
{
return
NewKey
(
k
.
string
+
"/"
+
s
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment