1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-05-20 08:27:29 +08:00
Files
kubo/repo/repo.go
Jakub Sztandera cafd81c8c6 Import go-datastore to gx
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2016-06-12 08:47:15 +02:00

37 lines
746 B
Go

package repo
import (
"errors"
"io"
config "github.com/ipfs/go-ipfs/repo/config"
ds "gx/ipfs/QmZ6A6P6AMo8SR3jXAwzTuSU6B9R2Y4eqW2yW9VvfUayDN/go-datastore"
)
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.Batching // should be threadsafe, just be careful
io.Closer
}