mirror of
https://github.com/ipfs/kubo.git
synced 2025-09-10 14:34:24 +08:00

- Modified Godeps/Godeps.json by hand - [TEST] Updated welcome docs hash to sharness - [TEST] Updated contact doc - [TEST] disabled breaking test (t0080-repo refs local)
38 lines
761 B
Go
38 lines
761 B
Go
package repo
|
|
|
|
import (
|
|
"errors"
|
|
|
|
ds "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-datastore"
|
|
"github.com/ipfs/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 }
|