diff --git a/core/commands/bootstrap.go b/core/commands/bootstrap.go index 6cdda8974..c3cfeee7b 100644 --- a/core/commands/bootstrap.go +++ b/core/commands/bootstrap.go @@ -228,7 +228,7 @@ func bootstrapWritePeers(w io.Writer, prefix string, peers []config.BootstrapPee return nil } -func bootstrapAdd(r repo.Interface, cfg *config.Config, peers []config.BootstrapPeer) ([]config.BootstrapPeer, error) { +func bootstrapAdd(r repo.Repo, cfg *config.Config, peers []config.BootstrapPeer) ([]config.BootstrapPeer, error) { added := make([]config.BootstrapPeer, 0, len(peers)) for _, peer := range peers { @@ -253,7 +253,7 @@ func bootstrapAdd(r repo.Interface, cfg *config.Config, peers []config.Bootstrap return added, nil } -func bootstrapRemove(r repo.Interface, cfg *config.Config, toRemove []config.BootstrapPeer) ([]config.BootstrapPeer, error) { +func bootstrapRemove(r repo.Repo, cfg *config.Config, toRemove []config.BootstrapPeer) ([]config.BootstrapPeer, error) { removed := make([]config.BootstrapPeer, 0, len(toRemove)) keep := make([]config.BootstrapPeer, 0, len(cfg.Bootstrap)) @@ -280,7 +280,7 @@ func bootstrapRemove(r repo.Interface, cfg *config.Config, toRemove []config.Boo return removed, nil } -func bootstrapRemoveAll(r repo.Interface, cfg *config.Config) ([]config.BootstrapPeer, error) { +func bootstrapRemoveAll(r repo.Repo, cfg *config.Config) ([]config.BootstrapPeer, error) { removed := make([]config.BootstrapPeer, len(cfg.Bootstrap)) copy(removed, cfg.Bootstrap) diff --git a/core/commands/config.go b/core/commands/config.go index a091ad41c..e5cf3d386 100644 --- a/core/commands/config.go +++ b/core/commands/config.go @@ -143,7 +143,7 @@ variable set to your preferred text editor. }, } -func getConfig(r repo.Interface, key string) (*ConfigField, error) { +func getConfig(r repo.Repo, key string) (*ConfigField, error) { value, err := r.GetConfigKey(key) if err != nil { return nil, fmt.Errorf("Failed to get config value: %s", err) @@ -154,7 +154,7 @@ func getConfig(r repo.Interface, key string) (*ConfigField, error) { }, nil } -func setConfig(r repo.Interface, key, value string) (*ConfigField, error) { +func setConfig(r repo.Repo, key, value string) (*ConfigField, error) { err := r.SetConfigKey(key, value) if err != nil { return nil, fmt.Errorf("Failed to set config value: %s", err) diff --git a/repo/fsrepo/fsrepo.go b/repo/fsrepo/fsrepo.go index 1857751ef..5698acd44 100644 --- a/repo/fsrepo/fsrepo.go +++ b/repo/fsrepo/fsrepo.go @@ -222,7 +222,7 @@ func (r *FSRepo) Close() error { } var _ io.Closer = &FSRepo{} -var _ repo.Interface = &FSRepo{} +var _ repo.Repo = &FSRepo{} // IsInitialized returns true if the repo is initialized at provided |path|. func IsInitialized(path string) bool { diff --git a/repo/repo.go b/repo/repo.go index fef058f4a..dc7689f31 100644 --- a/repo/repo.go +++ b/repo/repo.go @@ -5,7 +5,7 @@ import ( util "github.com/jbenet/go-ipfs/util" ) -type Interface interface { +type Repo interface { Config() *config.Config SetConfig(*config.Config) error