Skip to content

Commit

Permalink
Rename provide module to provider
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelavila committed Dec 12, 2018
1 parent 79bec0b commit 33718df
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 11 deletions.
1 change: 0 additions & 1 deletion core/commands/dag/dag.go
Expand Up @@ -145,7 +145,6 @@ into an object of the specified format.
}

return cids.ForEach(func(cid cid.Cid) error {
// TODO: This should be happening in CoreAPI
api.Provider().Provide(cid)
return nil
})
Expand Down
8 changes: 4 additions & 4 deletions core/core.go
Expand Up @@ -14,13 +14,13 @@ import (
"context"
"errors"
"fmt"
"github.com/ipfs/go-ipfs/provide"
"io"
"io/ioutil"
"os"
"strings"
"time"

provider "github.com/ipfs/go-ipfs/provider"
version "github.com/ipfs/go-ipfs"
rp "github.com/ipfs/go-ipfs/exchange/reprovide"
filestore "github.com/ipfs/go-ipfs/filestore"
Expand Down Expand Up @@ -134,7 +134,7 @@ type IpfsNode struct {
Exchange exchange.Interface // the block exchange + strategy (bitswap)
Namesys namesys.NameSystem // the name system, resolves paths to hashes
Reprovider *rp.Reprovider // the value reprovider system
Provider *provide.Provider // the value provider system
Provider *provider.Provider // the value provider system
IpnsRepub *ipnsrp.Republisher

PubSub *pubsub.PubSub
Expand Down Expand Up @@ -322,8 +322,8 @@ func (n *IpfsNode) startLateOnlineServices(ctx context.Context) error {
// Provider

// TODO: Make strategy configurable
strategy := provide.NewProvideAllStrategy(n.DAG)
n.Provider = provide.NewProvider(ctx, strategy, n.Routing)
strategy := provider.NewProvideAllStrategy(n.DAG)
n.Provider = provider.NewProvider(ctx, strategy, n.Routing)
go n.Provider.Run()

// Reprovider
Expand Down
2 changes: 1 addition & 1 deletion core/coreapi/interface/dht.go
Expand Up @@ -21,6 +21,6 @@ type DhtAPI interface {
// given a key.
FindProviders(context.Context, Path, ...options.DhtFindProvidersOption) (<-chan pstore.PeerInfo, error)

// Provider announces to the network that you are providing given values
// Provide announces to the network that you are providing given values
Provide(context.Context, Path, ...options.DhtProvideOption) error
}
2 changes: 1 addition & 1 deletion core/coreapi/interface/options/dht.go
Expand Up @@ -43,7 +43,7 @@ type dhtOpts struct{}

var Dht dhtOpts

// Recursive is an option for Dht.Provider which specifies whether to provide
// Recursive is an option for Dht.Provide which specifies whether to provide
// the given path recursively
func (dhtOpts) Recursive(recursive bool) DhtProvideOption {
return func(settings *DhtProvideSettings) error {
Expand Down
1 change: 0 additions & 1 deletion core/coreapi/unixfs.go
Expand Up @@ -131,7 +131,6 @@ func (api *UnixfsAPI) Add(ctx context.Context, files files.File, opts ...options
return nil, err
}

// TODO: Move providing from cmd/add to here
if !settings.Local {
api.core().Provider().Provide(nd.Cid())
}
Expand Down
1 change: 0 additions & 1 deletion core/corehttp/gateway_handler.go
@@ -1,4 +1,3 @@

package corehttp

import (
Expand Down
2 changes: 1 addition & 1 deletion provide/provider.go → provider/provider.go
@@ -1,4 +1,4 @@
package provide
package provider

import (
"context"
Expand Down
2 changes: 1 addition & 1 deletion provide/strategy.go → provider/strategy.go
@@ -1,4 +1,4 @@
package provide
package provider

import (
"context"
Expand Down

1 comment on commit 33718df

@GitCop
Copy link

@GitCop GitCop commented on 33718df Dec 12, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There were the following issues with your Pull Request

We ask for a few features in the commit message for Open Source licensing hygiene and commit message clarity.
git commit --amend can often help you quickly improve the commit message.
Guidelines and a script are available to help in the long run.
Your feedback on GitCop is welcome on this issue.


This message was auto-generated by https://gitcop.com

Please sign in to comment.