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
9b38e483
Commit
9b38e483
authored
Sep 12, 2014
by
Juan Batiz-Benet
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2 from whyrusleeping/master
log datastore needed newlines
parents
e89f0511
ce4a22fe
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
8 deletions
+6
-8
basic_ds.go
basic_ds.go
+6
-8
No files found.
basic_ds.go
View file @
9b38e483
package
datastore
package
datastore
import
(
import
"log"
"log"
)
// Here are some basic datastore implementations.
// Here are some basic datastore implementations.
...
@@ -92,27 +90,27 @@ func NewLogDatastore(ds Datastore, name string) *LogDatastore {
...
@@ -92,27 +90,27 @@ func NewLogDatastore(ds Datastore, name string) *LogDatastore {
}
}
func
(
d
*
LogDatastore
)
Put
(
key
Key
,
value
interface
{})
(
err
error
)
{
func
(
d
*
LogDatastore
)
Put
(
key
Key
,
value
interface
{})
(
err
error
)
{
log
.
Printf
(
"%s: Put %s"
,
d
.
Name
,
key
)
log
.
Printf
(
"%s: Put %s
\n
"
,
d
.
Name
,
key
)
// log.Printf("%s: Put %s ```%s```", d.Name, key, value)
// log.Printf("%s: Put %s ```%s```", d.Name, key, value)
return
d
.
Child
.
Put
(
key
,
value
)
return
d
.
Child
.
Put
(
key
,
value
)
}
}
func
(
d
*
LogDatastore
)
Get
(
key
Key
)
(
value
interface
{},
err
error
)
{
func
(
d
*
LogDatastore
)
Get
(
key
Key
)
(
value
interface
{},
err
error
)
{
log
.
Printf
(
"%s: Get %s"
,
d
.
Name
,
key
)
log
.
Printf
(
"%s: Get %s
\n
"
,
d
.
Name
,
key
)
return
d
.
Child
.
Get
(
key
)
return
d
.
Child
.
Get
(
key
)
}
}
func
(
d
*
LogDatastore
)
Has
(
key
Key
)
(
exists
bool
,
err
error
)
{
func
(
d
*
LogDatastore
)
Has
(
key
Key
)
(
exists
bool
,
err
error
)
{
log
.
Printf
(
"%s: Has %s"
,
d
.
Name
,
key
)
log
.
Printf
(
"%s: Has %s
\n
"
,
d
.
Name
,
key
)
return
d
.
Child
.
Has
(
key
)
return
d
.
Child
.
Has
(
key
)
}
}
func
(
d
*
LogDatastore
)
Delete
(
key
Key
)
(
err
error
)
{
func
(
d
*
LogDatastore
)
Delete
(
key
Key
)
(
err
error
)
{
log
.
Printf
(
"%s: Delete %s"
,
d
.
Name
,
key
)
log
.
Printf
(
"%s: Delete %s
\n
"
,
d
.
Name
,
key
)
return
d
.
Child
.
Delete
(
key
)
return
d
.
Child
.
Delete
(
key
)
}
}
func
(
d
*
LogDatastore
)
KeyList
()
([]
Key
,
error
)
{
func
(
d
*
LogDatastore
)
KeyList
()
([]
Key
,
error
)
{
log
.
Printf
(
"%s: Get KeyList
.
"
,
d
.
Name
)
log
.
Printf
(
"%s: Get KeyList
\n
"
,
d
.
Name
)
return
d
.
Child
.
KeyList
()
return
d
.
Child
.
KeyList
()
}
}
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