1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-09-10 14:34:24 +08:00
Files
kubo/repo/repo.go
Tommi Virtanen b76581d6c7 fsrepo: Refactor to extract datastore internals
License: MIT
Signed-off-by: Tommi Virtanen <tv@eagain.net>
2016-01-12 08:22:55 -08:00

38 lines
757 B
Go

package repo
import (
"errors"
"io"
ds "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-datastore"
config "github.com/ipfs/go-ipfs/repo/config"
)
var (
ErrApiNotRunning = errors.New("api not running")
)
type Repo interface {
Config() (*config.Config, error)
SetConfig(*config.Config) error
SetConfigKey(key string, value interface{}) error
GetConfigKey(key string) (interface{}, error)
Datastore() Datastore
GetStorageUsage() (uint64, error)
// SetAPIAddr sets the API address in the repo.
SetAPIAddr(addr string) error
io.Closer
}
// Datastore is the interface required from a datastore to be
// acceptable to FSRepo.
type Datastore interface {
ds.Datastore // should be threadsafe, just be careful
io.Closer
}