Skip to content

Commit

Permalink
Move internal/api/* to api/*
Browse files Browse the repository at this point in the history
  • Loading branch information
mikelsr committed Jul 10, 2023
1 parent 29af282 commit e2adf2f
Show file tree
Hide file tree
Showing 34 changed files with 60 additions and 60 deletions.
42 changes: 21 additions & 21 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,55 +15,55 @@ capnp: capnp-anchor capnp-pubsub capnp-cluster capnp-channel capnp-process capnp
# on the GOPATH.

capnp-anchor:
@mkdir -p internal/api/anchor
@capnp compile -I$(GOPATH)/src/capnproto.org/go/capnp/std -ogo:internal/api/anchor --src-prefix=api api/anchor.capnp
@mkdir -p api/anchor
@capnp compile -I$(GOPATH)/src/capnproto.org/go/capnp/v3/std -ogo:api/anchor --src-prefix=api api/anchor.capnp

capnp-pubsub:
@mkdir -p internal/api/pubsub
@capnp compile -I$(GOPATH)/src/capnproto.org/go/capnp/std -ogo:internal/api/pubsub --src-prefix=api api/pubsub.capnp
@mkdir -p api/pubsub
@capnp compile -I$(GOPATH)/src/capnproto.org/go/capnp/v3/std -ogo:api/pubsub --src-prefix=api api/pubsub.capnp

capnp-cluster:
@mkdir -p internal/api/cluster
@capnp compile -I$(GOPATH)/src/capnproto.org/go/capnp/std -ogo:internal/api/cluster --src-prefix=api api/cluster.capnp
@mkdir -p api/cluster
@capnp compile -I$(GOPATH)/src/capnproto.org/go/capnp/v3/std -ogo:api/cluster --src-prefix=api api/cluster.capnp

capnp-channel:
@mkdir -p internal/api/channel
@capnp compile -I$(GOPATH)/src/capnproto.org/go/capnp/std -ogo:internal/api/channel --src-prefix=api api/channel.capnp
@mkdir -p api/channel
@capnp compile -I$(GOPATH)/src/capnproto.org/go/capnp/v3/std -ogo:api/channel --src-prefix=api api/channel.capnp

capnp-process:
@mkdir -p internal/api/process
@capnp compile -I$(GOPATH)/src/capnproto.org/go/capnp/std -ogo:internal/api/process --src-prefix=api api/process.capnp
@mkdir -p api/process
@capnp compile -I$(GOPATH)/src/capnproto.org/go/capnp/v3/std -ogo:api/process --src-prefix=api api/process.capnp

capnp-registry:
@mkdir -p internal/api/registry
@capnp compile -I$(GOPATH)/src/capnproto.org/go/capnp/std -ogo:internal/api/registry --src-prefix=api api/registry.capnp
@mkdir -p api/registry
@capnp compile -I$(GOPATH)/src/capnproto.org/go/capnp/v3/std -ogo:api/registry --src-prefix=api api/registry.capnp

capnp-bitswap:
@mkdir -p internal/api/bitswap
@capnp compile -I$(GOPATH)/src/capnproto.org/go/capnp/std -ogo:internal/api/bitswap --src-prefix=api api/bitswap.capnp
@mkdir -p api/bitswap
@capnp compile -I$(GOPATH)/src/capnproto.org/go/capnp/v3/std -ogo:api/bitswap --src-prefix=api api/bitswap.capnp

clean-capnp: clean-capnp-anchor clean-capnp-pubsub clean-capnp-cluster clean-capnp-channel clean-capnp-process clean-capnp-registry clean-capnp-bitswap

clean-capnp-anchor:
@rm -rf internal/api/anchor
@rm -rf api/anchor

clean-capnp-pubsub:
@rm -rf internal/api/pubsub
@rm -rf api/pubsub

clean-capnp-cluster:
@rm -rf internal/api/cluster
@rm -rf api/cluster

clean-capnp-channel:
@rm -rf internal/api/channel
@rm -rf api/channel

clean-capnp-process:
@rm -rf internal/api/process
@rm -rf api/process

clean-capnp-registry:
@rm -rf internal/api/registry
@rm -rf api/registry

clean-capnp-bitswap:
@rm -rf internal/api/bitswap
@rm -rf api/bitswap

mocks: clean-mocks
# This roundabout call to 'go generate' allows us to:
Expand Down
2 changes: 1 addition & 1 deletion api/anchor.capnp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ using Go = import "/go.capnp";
@0xefb5a91f96d44de3;

$Go.package("anchor");
$Go.import("github.com/wetware/ww/internal/api/anchor");
$Go.import("github.com/wetware/ww/api/anchor");


interface Anchor {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion api/bitswap.capnp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ using Go = import "/go.capnp";
@0xced7a3b0e18b5291;

$Go.package("bitswap");
$Go.import("github.com/wetware/ww/internal/api/bitswap");
$Go.import("github.com/wetware/ww/api/bitswap");


interface BitSwap {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion api/channel.capnp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ using Go = import "/go.capnp";
@0x872a451f9aa74ebf;

$Go.package("channel");
$Go.import("github.com/wetware/ww/internal/api/channel");
$Go.import("github.com/wetware/ww/api/channel");


interface Closer {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion api/cluster.capnp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ using Go = import "/go.capnp";
@0xfcf6ac08e448a6ac;

$Go.package("cluster");
$Go.import("github.com/wetware/ww/internal/api/cluster");
$Go.import("github.com/wetware/ww/api/cluster");


interface Host {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/process.capnp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ using Go = import "/go.capnp";
@0x9a51e53177277763;

$Go.package("process");
$Go.import("github.com/wetware/ww/internal/api/process");
$Go.import("github.com/wetware/ww/api/process");


interface Executor {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion api/pubsub.capnp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ using Go = import "/go.capnp";
@0xf9d8a0180405d9ed;

$Go.package("pubsub");
$Go.import("github.com/wetware/ww/internal/api/pubsub");
$Go.import("github.com/wetware/ww/api/pubsub");


interface Topic {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion api/registry.capnp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ using Go = import "/go.capnp";
@0xfcba4f486a351ac3;

$Go.package("registry");
$Go.import("github.com/wetware/ww/internal/api/registry");
$Go.import("github.com/wetware/ww/api/registry");


using Envelope = Data;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/anchor/anchor.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"errors"

"capnproto.org/go/capnp/v3"
api "github.com/wetware/ww/internal/api/anchor"
api "github.com/wetware/ww/api/anchor"
"github.com/wetware/ww/pkg/internal/bounded"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/anchor/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"sync/atomic"

"capnproto.org/go/capnp/v3"
api "github.com/wetware/ww/internal/api/anchor"
api "github.com/wetware/ww/api/anchor"
)

type Node struct {
Expand Down
2 changes: 1 addition & 1 deletion pkg/bitswap/bitswap.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"capnproto.org/go/capnp/v3"
blocks "github.com/ipfs/go-block-format"
"github.com/ipfs/go-cid"
api "github.com/wetware/ww/internal/api/bitswap"
api "github.com/wetware/ww/api/bitswap"
)

// Exchange is the local peer's BitSwap exchange. It is wrapped by Server
Expand Down
2 changes: 1 addition & 1 deletion pkg/csp/chan.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"capnproto.org/go/capnp/v3"
casm "github.com/wetware/casm/pkg"
api "github.com/wetware/ww/internal/api/channel"
api "github.com/wetware/ww/api/channel"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion pkg/csp/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"lukechampine.com/blake3"

wasm "github.com/tetratelabs/wazero/api"
api "github.com/wetware/ww/internal/api/process"
api "github.com/wetware/ww/api/process"
"github.com/wetware/ww/pkg/csp/proc"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/csp/proc.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/tetratelabs/wazero/sys"

casm "github.com/wetware/casm/pkg"
api "github.com/wetware/ww/internal/api/process"
api "github.com/wetware/ww/api/process"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion pkg/csp/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"sync"

"capnproto.org/go/capnp/v3"
api "github.com/wetware/ww/internal/api/channel"
api "github.com/wetware/ww/api/channel"
)

var _ ChanServer = (*SyncChan)(nil)
Expand Down
10 changes: 5 additions & 5 deletions pkg/host/host.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import (
casm "github.com/wetware/casm/pkg"
"github.com/wetware/casm/pkg/cluster"
"github.com/wetware/casm/pkg/debug"
anchor_api "github.com/wetware/ww/internal/api/anchor"
api "github.com/wetware/ww/internal/api/cluster"
process_api "github.com/wetware/ww/internal/api/process"
pubsub_api "github.com/wetware/ww/internal/api/pubsub"
reg_api "github.com/wetware/ww/internal/api/registry"
anchor_api "github.com/wetware/ww/api/anchor"
api "github.com/wetware/ww/api/cluster"
process_api "github.com/wetware/ww/api/process"
pubsub_api "github.com/wetware/ww/api/pubsub"
reg_api "github.com/wetware/ww/api/registry"
"github.com/wetware/ww/pkg/anchor"
"github.com/wetware/ww/pkg/csp"
"github.com/wetware/ww/pkg/pubsub"
Expand Down
2 changes: 1 addition & 1 deletion pkg/pubsub/pubsub.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package pubsub
import (
"context"

api "github.com/wetware/ww/internal/api/pubsub"
api "github.com/wetware/ww/api/pubsub"
)

type (
Expand Down
2 changes: 1 addition & 1 deletion pkg/pubsub/refcount.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
capnp "capnproto.org/go/capnp/v3"
pubsub "github.com/libp2p/go-libp2p-pubsub"
"github.com/lthibault/log"
api "github.com/wetware/ww/internal/api/pubsub"
api "github.com/wetware/ww/api/pubsub"
)

// topicManager is responsible for refcounting *pubsub.Topic instances.
Expand Down
2 changes: 1 addition & 1 deletion pkg/pubsub/refcount_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
logtest "github.com/lthibault/log/test"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
api "github.com/wetware/ww/internal/api/pubsub"
api "github.com/wetware/ww/api/pubsub"
)

func TestTopicManager(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/pubsub/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
capnp "capnproto.org/go/capnp/v3"
pubsub "github.com/libp2p/go-libp2p-pubsub"
"github.com/lthibault/log"
api "github.com/wetware/ww/internal/api/pubsub"
api "github.com/wetware/ww/api/pubsub"
)

// Router is a client capability that confers the right to join pubsub
Expand Down
2 changes: 1 addition & 1 deletion pkg/pubsub/subscription.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"capnproto.org/go/capnp/v3/exp/bufferpool"
casm "github.com/wetware/casm/pkg"
api "github.com/wetware/ww/internal/api/pubsub"
api "github.com/wetware/ww/api/pubsub"
)

// Subscription is a stateful iterator over a stream of topic messages.
Expand Down
2 changes: 1 addition & 1 deletion pkg/pubsub/topic.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/lthibault/log"

casm "github.com/wetware/casm/pkg"
api "github.com/wetware/ww/internal/api/pubsub"
api "github.com/wetware/ww/api/pubsub"
)

// Topic is the handle for a pubsub topic. It is used to publish to
Expand Down
2 changes: 1 addition & 1 deletion pkg/pubsub/topic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

api "github.com/wetware/ww/internal/api/pubsub"
api "github.com/wetware/ww/api/pubsub"
mock_pubsub "github.com/wetware/ww/internal/mock/pkg/pubsub"
"github.com/wetware/ww/pkg/pubsub"
)
Expand Down
6 changes: 3 additions & 3 deletions pkg/registry/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"capnproto.org/go/capnp/v3"
"github.com/libp2p/go-libp2p/core/record"
casm "github.com/wetware/casm/pkg"
chan_api "github.com/wetware/ww/internal/api/channel"
ps_api "github.com/wetware/ww/internal/api/pubsub"
api "github.com/wetware/ww/internal/api/registry"
chan_api "github.com/wetware/ww/api/channel"
ps_api "github.com/wetware/ww/api/pubsub"
api "github.com/wetware/ww/api/registry"
"github.com/wetware/ww/pkg/pubsub"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/registry/registry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
inproc "github.com/lthibault/go-libp2p-inproc-transport"
ma "github.com/multiformats/go-multiaddr"
"github.com/stretchr/testify/require"
api "github.com/wetware/ww/internal/api/registry"
api "github.com/wetware/ww/api/registry"
pscap "github.com/wetware/ww/pkg/pubsub"
service "github.com/wetware/ww/pkg/registry"
)
Expand Down
4 changes: 2 additions & 2 deletions pkg/registry/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"fmt"

"capnproto.org/go/capnp/v3"
"github.com/wetware/ww/internal/api/channel"
api "github.com/wetware/ww/internal/api/registry"
"github.com/wetware/ww/api/channel"
api "github.com/wetware/ww/api/registry"
"github.com/wetware/ww/pkg/pubsub"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/registry/structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"capnproto.org/go/capnp/v3"
"github.com/libp2p/go-libp2p-core/record"
ma "github.com/multiformats/go-multiaddr"
api "github.com/wetware/ww/internal/api/registry"
api "github.com/wetware/ww/api/registry"
)

// TODO: register this once stable.
Expand Down

0 comments on commit e2adf2f

Please sign in to comment.