Skip to content

Commit

Permalink
refactor: go.mod, package name
Browse files Browse the repository at this point in the history
  • Loading branch information
lidel committed May 9, 2022
1 parent 44f6b2c commit fce44e1
Show file tree
Hide file tree
Showing 196 changed files with 514 additions and 487 deletions.
4 changes: 2 additions & 2 deletions .circleci/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,11 @@ jobs:
cp go.sum go.sum.bak
# make sure the examples run against the current version of go-ipfs
go mod edit -replace github.com/ipfs/go-ipfs=./../../..
go mod edit -replace github.com/ipfs/ipfs-banana=./../../..
go mod tidy
# use the internal config package when we test the current version of go-ipfs
sed -i.bak 's;"github.com/ipfs/go-ipfs-config";"github.com/ipfs/go-ipfs/config";' ./main.go
sed -i.bak 's;"github.com/ipfs/go-ipfs-config";"github.com/ipfs/ipfs-banana/config";' ./main.go
go test -v ./...
Expand Down
4 changes: 2 additions & 2 deletions assets/assets.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
gopath "path"
"strconv"

"github.com/ipfs/go-ipfs/core"
"github.com/ipfs/go-ipfs/core/coreapi"
"github.com/ipfs/ipfs-banana/core"
"github.com/ipfs/ipfs-banana/core/coreapi"

"github.com/cespare/xxhash"
cid "github.com/ipfs/go-cid"
Expand Down
4 changes: 2 additions & 2 deletions cmd/ipfs/Rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ PATH := $(realpath $(d)):$(PATH)
# DEPS_OO_$(d) += merkledag/pb/merkledag.pb.go namesys/pb/namesys.pb.go
# DEPS_OO_$(d) += pin/internal/pb/header.pb.go unixfs/pb/unixfs.pb.go

$(d)_flags =-ldflags="-X "github.com/ipfs/go-ipfs".CurrentCommit=$(git-hash)"
$(d)_flags =-ldflags="-X "github.com/ipfs/ipfs-banana".CurrentCommit=$(git-hash)"

$(d)-try-build $(IPFS_BIN_$(d)): GOFLAGS += $(cmd/ipfs_flags)

Expand Down Expand Up @@ -42,7 +42,7 @@ CLEAN += $(COVER_BIN_$(d))

$(COVER_BIN_$(d)): GOTAGS += testrunmain
$(COVER_BIN_$(d)): $(d) $$(DEPS_GO) ALWAYS
$(eval TMP_PKGS := $(shell $(GOCC) list -f '{{range .Deps}}{{.}} {{end}}' $(go-flags-with-tags) ./cmd/ipfs | sed 's/ /\n/g' | grep ipfs/go-ipfs) $(call go-pkg-name,$<))
$(eval TMP_PKGS := $(shell $(GOCC) list -f '{{range .Deps}}{{.}} {{end}}' $(go-flags-with-tags) ./cmd/ipfs | sed 's/ /\n/g' | grep ipfs/ipfs-banana) $(call go-pkg-name,$<))
$(eval TMP_LIST := $(call join-with,$(comma),$(TMP_PKGS)))
@echo $(GOCC) test $@ -c -covermode atomic -coverpkg ... $(go-flags-with-tags) ./$(@D) # for info
@$(GOCC) test -o $@ -c -covermode atomic -coverpkg $(TMP_LIST) $(go-flags-with-tags) ./$(@D) 2>&1 | (grep -v 'warning: no packages being tested' || true)
Expand Down
10 changes: 5 additions & 5 deletions cmd/ipfs/add_migrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import (
"path/filepath"

files "github.com/ipfs/go-ipfs-files"
"github.com/ipfs/go-ipfs/core"
"github.com/ipfs/go-ipfs/core/coreapi"
"github.com/ipfs/go-ipfs/repo/fsrepo/migrations"
"github.com/ipfs/go-ipfs/repo/fsrepo/migrations/ipfsfetcher"
"github.com/ipfs/ipfs-banana/core"
"github.com/ipfs/ipfs-banana/core/coreapi"
"github.com/ipfs/ipfs-banana/repo/fsrepo/migrations"
"github.com/ipfs/ipfs-banana/repo/fsrepo/migrations/ipfsfetcher"
coreiface "github.com/ipfs/interface-go-ipfs-core"
"github.com/ipfs/interface-go-ipfs-core/options"
ipath "github.com/ipfs/interface-go-ipfs-core/path"
Expand All @@ -37,7 +37,7 @@ func addMigrations(ctx context.Context, node *core.IpfsNode, fetcher migrations.
if err != nil {
return err
}
case *migrations.HttpFetcher, *migrations.RetryFetcher: // https://github.com/ipfs/go-ipfs/issues/8780
case *migrations.HttpFetcher, *migrations.RetryFetcher: // https://github.com/ipfs/ipfs-banana/issues/8780
// Add the downloaded migration files directly
if migrations.DownloadDirectory != "" {
var paths []string
Expand Down
32 changes: 16 additions & 16 deletions cmd/ipfs/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@ import (

multierror "github.com/hashicorp/go-multierror"

version "github.com/ipfs/go-ipfs"
utilmain "github.com/ipfs/go-ipfs/cmd/ipfs/util"
oldcmds "github.com/ipfs/go-ipfs/commands"
config "github.com/ipfs/go-ipfs/config"
cserial "github.com/ipfs/go-ipfs/config/serialize"
"github.com/ipfs/go-ipfs/core"
commands "github.com/ipfs/go-ipfs/core/commands"
"github.com/ipfs/go-ipfs/core/coreapi"
corehttp "github.com/ipfs/go-ipfs/core/corehttp"
corerepo "github.com/ipfs/go-ipfs/core/corerepo"
libp2p "github.com/ipfs/go-ipfs/core/node/libp2p"
nodeMount "github.com/ipfs/go-ipfs/fuse/node"
fsrepo "github.com/ipfs/go-ipfs/repo/fsrepo"
"github.com/ipfs/go-ipfs/repo/fsrepo/migrations"
"github.com/ipfs/go-ipfs/repo/fsrepo/migrations/ipfsfetcher"
version "github.com/ipfs/ipfs-banana"
utilmain "github.com/ipfs/ipfs-banana/cmd/ipfs/util"
oldcmds "github.com/ipfs/ipfs-banana/commands"
config "github.com/ipfs/ipfs-banana/config"
cserial "github.com/ipfs/ipfs-banana/config/serialize"
"github.com/ipfs/ipfs-banana/core"
commands "github.com/ipfs/ipfs-banana/core/commands"
"github.com/ipfs/ipfs-banana/core/coreapi"
corehttp "github.com/ipfs/ipfs-banana/core/corehttp"
corerepo "github.com/ipfs/ipfs-banana/core/corerepo"
libp2p "github.com/ipfs/ipfs-banana/core/node/libp2p"
nodeMount "github.com/ipfs/ipfs-banana/fuse/node"
fsrepo "github.com/ipfs/ipfs-banana/repo/fsrepo"
"github.com/ipfs/ipfs-banana/repo/fsrepo/migrations"
"github.com/ipfs/ipfs-banana/repo/fsrepo/migrations/ipfsfetcher"
sockets "github.com/libp2p/go-socket-activation"

cmds "github.com/ipfs/go-ipfs-cmds"
Expand Down Expand Up @@ -801,7 +801,7 @@ func serveHTTPGateway(req *cmds.Request, cctx *oldcmds.Context) (<-chan error, e
}

if len(cfg.Gateway.PathPrefixes) > 0 {
log.Error("Support for X-Ipfs-Gateway-Prefix and Gateway.PathPrefixes is deprecated and will be removed in the next release. Please comment on the issue if you're using this feature: https://github.com/ipfs/go-ipfs/issues/7702")
log.Error("Support for X-Ipfs-Gateway-Prefix and Gateway.PathPrefixes is deprecated and will be removed in the next release. Please comment on the issue if you're using this feature: https://github.com/ipfs/ipfs-banana/issues/7702")
}

node, err := cctx.ConstructNode()
Expand Down
2 changes: 1 addition & 1 deletion cmd/ipfs/debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"net/http"

"github.com/ipfs/go-ipfs/profile"
"github.com/ipfs/ipfs-banana/profile"
)

func init() {
Expand Down
12 changes: 6 additions & 6 deletions cmd/ipfs/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ import (
"path/filepath"
"strings"

assets "github.com/ipfs/go-ipfs/assets"
oldcmds "github.com/ipfs/go-ipfs/commands"
core "github.com/ipfs/go-ipfs/core"
"github.com/ipfs/go-ipfs/core/commands"
fsrepo "github.com/ipfs/go-ipfs/repo/fsrepo"
assets "github.com/ipfs/ipfs-banana/assets"
oldcmds "github.com/ipfs/ipfs-banana/commands"
core "github.com/ipfs/ipfs-banana/core"
"github.com/ipfs/ipfs-banana/core/commands"
fsrepo "github.com/ipfs/ipfs-banana/repo/fsrepo"
path "github.com/ipfs/go-path"
unixfs "github.com/ipfs/go-unixfs"

cmds "github.com/ipfs/go-ipfs-cmds"
files "github.com/ipfs/go-ipfs-files"
config "github.com/ipfs/go-ipfs/config"
config "github.com/ipfs/ipfs-banana/config"
options "github.com/ipfs/interface-go-ipfs-core/options"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/ipfs/ipfs.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package main

import (
commands "github.com/ipfs/go-ipfs/core/commands"
commands "github.com/ipfs/ipfs-banana/core/commands"

cmds "github.com/ipfs/go-ipfs-cmds"
)
Expand Down
18 changes: 9 additions & 9 deletions cmd/ipfs/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ import (
"runtime/pprof"
"time"

util "github.com/ipfs/go-ipfs/cmd/ipfs/util"
oldcmds "github.com/ipfs/go-ipfs/commands"
core "github.com/ipfs/go-ipfs/core"
corecmds "github.com/ipfs/go-ipfs/core/commands"
corehttp "github.com/ipfs/go-ipfs/core/corehttp"
loader "github.com/ipfs/go-ipfs/plugin/loader"
repo "github.com/ipfs/go-ipfs/repo"
fsrepo "github.com/ipfs/go-ipfs/repo/fsrepo"
"github.com/ipfs/go-ipfs/tracing"
util "github.com/ipfs/ipfs-banana/cmd/ipfs/util"
oldcmds "github.com/ipfs/ipfs-banana/commands"
core "github.com/ipfs/ipfs-banana/core"
corecmds "github.com/ipfs/ipfs-banana/core/commands"
corehttp "github.com/ipfs/ipfs-banana/core/corehttp"
loader "github.com/ipfs/ipfs-banana/plugin/loader"
repo "github.com/ipfs/ipfs-banana/repo"
fsrepo "github.com/ipfs/ipfs-banana/repo/fsrepo"
"github.com/ipfs/ipfs-banana/tracing"
"go.opentelemetry.io/otel"

cmds "github.com/ipfs/go-ipfs-cmds"
Expand Down
4 changes: 2 additions & 2 deletions cmd/ipfs/pinmfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (
logging "github.com/ipfs/go-log"
pinclient "github.com/ipfs/go-pinning-service-http-client"

config "github.com/ipfs/go-ipfs/config"
"github.com/ipfs/go-ipfs/core"
config "github.com/ipfs/ipfs-banana/config"
"github.com/ipfs/ipfs-banana/core"
)

// mfslog is the logger for remote mfs pinning
Expand Down
2 changes: 1 addition & 1 deletion cmd/ipfs/pinmfs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"testing"
"time"

config "github.com/ipfs/go-ipfs/config"
config "github.com/ipfs/ipfs-banana/config"
ipld "github.com/ipfs/go-ipld-format"
merkledag "github.com/ipfs/go-merkledag"
"github.com/libp2p/go-libp2p-core/host"
Expand Down
2 changes: 1 addition & 1 deletion cmd/ipfswatch/ipfswatch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package main
import (
"testing"

"github.com/ipfs/go-ipfs/thirdparty/assert"
"github.com/ipfs/ipfs-banana/thirdparty/assert"
)

func TestIsHidden(t *testing.T) {
Expand Down
10 changes: 5 additions & 5 deletions cmd/ipfswatch/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ import (
"path/filepath"
"syscall"

commands "github.com/ipfs/go-ipfs/commands"
core "github.com/ipfs/go-ipfs/core"
coreapi "github.com/ipfs/go-ipfs/core/coreapi"
corehttp "github.com/ipfs/go-ipfs/core/corehttp"
fsrepo "github.com/ipfs/go-ipfs/repo/fsrepo"
commands "github.com/ipfs/ipfs-banana/commands"
core "github.com/ipfs/ipfs-banana/core"
coreapi "github.com/ipfs/ipfs-banana/core/coreapi"
corehttp "github.com/ipfs/ipfs-banana/core/corehttp"
fsrepo "github.com/ipfs/ipfs-banana/repo/fsrepo"

fsnotify "github.com/fsnotify/fsnotify"
files "github.com/ipfs/go-ipfs-files"
Expand Down
8 changes: 4 additions & 4 deletions commands/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import (
"strings"
"time"

core "github.com/ipfs/go-ipfs/core"
coreapi "github.com/ipfs/go-ipfs/core/coreapi"
loader "github.com/ipfs/go-ipfs/plugin/loader"
core "github.com/ipfs/ipfs-banana/core"
coreapi "github.com/ipfs/ipfs-banana/core/coreapi"
loader "github.com/ipfs/ipfs-banana/plugin/loader"

cmds "github.com/ipfs/go-ipfs-cmds"
config "github.com/ipfs/go-ipfs/config"
config "github.com/ipfs/ipfs-banana/config"
logging "github.com/ipfs/go-log"
coreiface "github.com/ipfs/interface-go-ipfs-core"
options "github.com/ipfs/interface-go-ipfs-core/options"
Expand Down
2 changes: 1 addition & 1 deletion config/experiments.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package config
type Experiments struct {
FilestoreEnabled bool
UrlstoreEnabled bool
ShardingEnabled bool `json:",omitempty"` // deprecated by autosharding: https://github.com/ipfs/go-ipfs/pull/8527
ShardingEnabled bool `json:",omitempty"` // deprecated by autosharding: https://github.com/ipfs/ipfs-banana/pull/8527
GraphsyncEnabled bool
Libp2pStreamMounting bool
P2pHttpProxy bool
Expand Down
2 changes: 1 addition & 1 deletion config/gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ type Gateway struct {
// Setting to 0 will enable fast listings for all directories.
FastDirIndexThreshold *OptionalInteger `json:",omitempty"`

// FIXME: Not yet implemented: https://github.com/ipfs/go-ipfs/issues/8059
// FIXME: Not yet implemented: https://github.com/ipfs/ipfs-banana/issues/8059
APICommands []string

// NoFetch configures the gateway to _not_ fetch blocks in response to
Expand Down
2 changes: 1 addition & 1 deletion config/serialize/serialize.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"os"
"path/filepath"

"github.com/ipfs/go-ipfs/config"
"github.com/ipfs/ipfs-banana/config"

"github.com/facebookgo/atomicfile"
)
Expand Down
2 changes: 1 addition & 1 deletion config/serialize/serialize_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"runtime"
"testing"

config "github.com/ipfs/go-ipfs/config"
config "github.com/ipfs/ipfs-banana/config"
)

func TestConfig(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions core/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"sync"
"time"

"github.com/ipfs/go-ipfs/core/bootstrap"
"github.com/ipfs/go-ipfs/core/node"
"github.com/ipfs/ipfs-banana/core/bootstrap"
"github.com/ipfs/ipfs-banana/core/node"

"github.com/ipfs/go-metrics-interface"
"go.uber.org/dig"
Expand Down
2 changes: 1 addition & 1 deletion core/commands/active.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"text/tabwriter"
"time"

oldcmds "github.com/ipfs/go-ipfs/commands"
oldcmds "github.com/ipfs/ipfs-banana/commands"

cmds "github.com/ipfs/go-ipfs-cmds"
)
Expand Down
2 changes: 1 addition & 1 deletion core/commands/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"path"
"strings"

"github.com/ipfs/go-ipfs/core/commands/cmdenv"
"github.com/ipfs/ipfs-banana/core/commands/cmdenv"

"github.com/cheggaaa/pb"
cmds "github.com/ipfs/go-ipfs-cmds"
Expand Down
4 changes: 2 additions & 2 deletions core/commands/bitswap.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"fmt"
"io"

cmdenv "github.com/ipfs/go-ipfs/core/commands/cmdenv"
e "github.com/ipfs/go-ipfs/core/commands/e"
cmdenv "github.com/ipfs/ipfs-banana/core/commands/cmdenv"
e "github.com/ipfs/ipfs-banana/core/commands/e"

humanize "github.com/dustin/go-humanize"
bitswap "github.com/ipfs/go-bitswap"
Expand Down
4 changes: 2 additions & 2 deletions core/commands/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (

files "github.com/ipfs/go-ipfs-files"

cmdenv "github.com/ipfs/go-ipfs/core/commands/cmdenv"
"github.com/ipfs/go-ipfs/core/commands/cmdutils"
cmdenv "github.com/ipfs/ipfs-banana/core/commands/cmdenv"
"github.com/ipfs/ipfs-banana/core/commands/cmdutils"

cmds "github.com/ipfs/go-ipfs-cmds"
options "github.com/ipfs/interface-go-ipfs-core/options"
Expand Down
8 changes: 4 additions & 4 deletions core/commands/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import (
"io"
"sort"

cmdenv "github.com/ipfs/go-ipfs/core/commands/cmdenv"
repo "github.com/ipfs/go-ipfs/repo"
fsrepo "github.com/ipfs/go-ipfs/repo/fsrepo"
cmdenv "github.com/ipfs/ipfs-banana/core/commands/cmdenv"
repo "github.com/ipfs/ipfs-banana/repo"
fsrepo "github.com/ipfs/ipfs-banana/repo/fsrepo"

cmds "github.com/ipfs/go-ipfs-cmds"
config "github.com/ipfs/go-ipfs/config"
config "github.com/ipfs/ipfs-banana/config"
peer "github.com/libp2p/go-libp2p-core/peer"
ma "github.com/multiformats/go-multiaddr"
)
Expand Down
2 changes: 1 addition & 1 deletion core/commands/cat.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"io"
"os"

"github.com/ipfs/go-ipfs/core/commands/cmdenv"
"github.com/ipfs/ipfs-banana/core/commands/cmdenv"

"github.com/cheggaaa/pb"
"github.com/ipfs/go-ipfs-cmds"
Expand Down
4 changes: 2 additions & 2 deletions core/commands/cmdenv/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"strconv"
"strings"

"github.com/ipfs/go-ipfs/commands"
"github.com/ipfs/go-ipfs/core"
"github.com/ipfs/ipfs-banana/commands"
"github.com/ipfs/ipfs-banana/core"

cmds "github.com/ipfs/go-ipfs-cmds"
logging "github.com/ipfs/go-log"
Expand Down
2 changes: 1 addition & 1 deletion core/commands/cmdutils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

const (
AllowBigBlockOptionName = "allow-big-block"
SoftBlockLimit = 1024 * 1024 // https://github.com/ipfs/go-ipfs/issues/7421#issuecomment-910833499
SoftBlockLimit = 1024 * 1024 // https://github.com/ipfs/ipfs-banana/issues/7421#issuecomment-910833499
)

var AllowBigBlockOption cmds.Option
Expand Down
2 changes: 1 addition & 1 deletion core/commands/commands.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Package commands implements the ipfs command interface
//
// Using github.com/ipfs/go-ipfs/commands to define the command line and HTTP
// Using github.com/ipfs/ipfs-banana/commands to define the command line and HTTP
// APIs. This is the interface available to folks using IPFS from outside of
// the Go language.
package commands
Expand Down
Loading

0 comments on commit fce44e1

Please sign in to comment.