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-unixfs
Commits
c9a89458
Commit
c9a89458
authored
Jan 14, 2015
by
Brian Tiger Chow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
repo/mock: basic impl
parent
03486a51
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
0 deletions
+37
-0
repo/mock.go
repo/mock.go
+37
-0
No files found.
repo/mock.go
0 → 100644
View file @
c9a89458
package
repo
import
(
"errors"
ds
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-datastore"
"github.com/jbenet/go-ipfs/repo/config"
)
var
errTODO
=
errors
.
New
(
"TODO"
)
// Mock is not thread-safe
type
Mock
struct
{
C
config
.
Config
D
ds
.
ThreadSafeDatastore
}
func
(
m
*
Mock
)
Config
()
*
config
.
Config
{
return
&
m
.
C
// FIXME threadsafety
}
func
(
m
*
Mock
)
SetConfig
(
updated
*
config
.
Config
)
error
{
m
.
C
=
*
updated
// FIXME threadsafety
return
nil
}
func
(
m
*
Mock
)
SetConfigKey
(
key
string
,
value
interface
{})
error
{
return
errTODO
}
func
(
m
*
Mock
)
GetConfigKey
(
key
string
)
(
interface
{},
error
)
{
return
nil
,
errTODO
}
func
(
m
*
Mock
)
Datastore
()
ds
.
ThreadSafeDatastore
{
return
m
.
D
}
func
(
m
*
Mock
)
Close
()
error
{
return
errTODO
}
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