summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2018-07-07 13:48:38 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2018-07-07 20:44:25 +0900
commitc4775c42510d1f1ddd55036dc19e982712fa6a0b (patch)
tree6ec8b61d4338c809e239e3003a2d32d480898e22
parentb3079759aa13172fcb548a83da9a9653d8d5fed4 (diff)
follow Standard Go Project Layout
https://github.com/golang-standards/project-layout Now you can see clearly what are private and public library code. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--.gitignore4
-rw-r--r--.goreleaser.yml4
-rw-r--r--.travis.yml14
-rw-r--r--api/attribute.go3
-rw-r--r--api/attribute_test.go3
-rw-r--r--api/capability.go3
-rw-r--r--api/capability_test.go3
-rw-r--r--api/util.go2
-rw-r--r--cmd/gobgp/cmd/bmp.go (renamed from gobgp/cmd/bmp.go)5
-rw-r--r--cmd/gobgp/cmd/common.go (renamed from gobgp/cmd/common.go)6
-rw-r--r--cmd/gobgp/cmd/common_test.go (renamed from gobgp/cmd/common_test.go)0
-rw-r--r--cmd/gobgp/cmd/global.go (renamed from gobgp/cmd/global.go)7
-rw-r--r--cmd/gobgp/cmd/global_test.go (renamed from gobgp/cmd/global_test.go)3
-rw-r--r--cmd/gobgp/cmd/monitor.go (renamed from gobgp/cmd/monitor.go)2
-rw-r--r--cmd/gobgp/cmd/mrt.go (renamed from gobgp/cmd/mrt.go)4
-rw-r--r--cmd/gobgp/cmd/neighbor.go (renamed from gobgp/cmd/neighbor.go)5
-rw-r--r--cmd/gobgp/cmd/policy.go (renamed from gobgp/cmd/policy.go)4
-rw-r--r--cmd/gobgp/cmd/root.go (renamed from gobgp/cmd/root.go)2
-rw-r--r--cmd/gobgp/cmd/rpki.go (renamed from gobgp/cmd/rpki.go)2
-rw-r--r--cmd/gobgp/cmd/rpki_test.go (renamed from gobgp/cmd/rpki_test.go)5
-rw-r--r--cmd/gobgp/cmd/vrf.go (renamed from gobgp/cmd/vrf.go)2
-rw-r--r--cmd/gobgp/lib/lib.go (renamed from gobgp/lib/lib.go)0
-rw-r--r--cmd/gobgp/lib/path.go (renamed from gobgp/lib/path.go)4
-rw-r--r--cmd/gobgp/main.go (renamed from gobgp/main.go)5
-rw-r--r--cmd/gobgpd/main.go (renamed from gobgpd/main.go)8
-rw-r--r--cmd/gobgpd/util.go (renamed from gobgpd/util.go)0
-rw-r--r--cmd/gobgpd/util_windows.go (renamed from gobgpd/util_windows.go)0
-rw-r--r--internal/pkg/client/client.go (renamed from client/client.go)6
-rw-r--r--internal/pkg/client/client_test.go (renamed from client/client_test.go)4
-rw-r--r--internal/pkg/config/bgp_configs.go (renamed from config/bgp_configs.go)2
-rw-r--r--internal/pkg/config/bgp_configs_test.go (renamed from config/bgp_configs_test.go)2
-rw-r--r--internal/pkg/config/default.go (renamed from config/default.go)7
-rw-r--r--internal/pkg/config/default_linux.go (renamed from config/default_linux.go)0
-rw-r--r--internal/pkg/config/default_nonlinux.go (renamed from config/default_nonlinux.go)0
-rw-r--r--internal/pkg/config/serve.go (renamed from config/serve.go)0
-rw-r--r--internal/pkg/config/util.go (renamed from config/util.go)2
-rw-r--r--internal/pkg/config/util_test.go (renamed from config/util_test.go)0
-rw-r--r--internal/pkg/table/adj.go (renamed from table/adj.go)2
-rw-r--r--internal/pkg/table/adj_test.go (renamed from table/adj_test.go)3
-rw-r--r--internal/pkg/table/destination.go (renamed from table/destination.go)6
-rw-r--r--internal/pkg/table/destination_test.go (renamed from table/destination_test.go)3
-rw-r--r--internal/pkg/table/message.go (renamed from table/message.go)2
-rw-r--r--internal/pkg/table/message_test.go (renamed from table/message_test.go)2
-rw-r--r--internal/pkg/table/path.go (renamed from table/path.go)6
-rw-r--r--internal/pkg/table/path_test.go (renamed from table/path_test.go)5
-rw-r--r--internal/pkg/table/policy.go (renamed from table/policy.go)4
-rw-r--r--internal/pkg/table/policy_test.go (renamed from table/policy_test.go)4
-rw-r--r--internal/pkg/table/roa.go (renamed from table/roa.go)0
-rw-r--r--internal/pkg/table/table.go (renamed from table/table.go)2
-rw-r--r--internal/pkg/table/table_manager.go (renamed from table/table_manager.go)4
-rw-r--r--internal/pkg/table/table_manager_test.go (renamed from table/table_manager_test.go)3
-rw-r--r--internal/pkg/table/table_test.go (renamed from table/table_test.go)3
-rw-r--r--internal/pkg/table/vrf.go (renamed from table/vrf.go)2
-rw-r--r--internal/pkg/zebra/afi_string.go (renamed from zebra/afi_string.go)0
-rw-r--r--internal/pkg/zebra/api_type_string.go (renamed from zebra/api_type_string.go)0
-rw-r--r--internal/pkg/zebra/link_type_string.go (renamed from zebra/link_type_string.go)0
-rw-r--r--internal/pkg/zebra/nexthop_flag_string.go (renamed from zebra/nexthop_flag_string.go)0
-rw-r--r--internal/pkg/zebra/ptm_enable_string.go (renamed from zebra/ptm_enable_string.go)0
-rw-r--r--internal/pkg/zebra/ptm_status_string.go (renamed from zebra/ptm_status_string.go)0
-rw-r--r--internal/pkg/zebra/route_type_string.go (renamed from zebra/route_type_string.go)0
-rw-r--r--internal/pkg/zebra/safi_string.go (renamed from zebra/safi_string.go)0
-rw-r--r--internal/pkg/zebra/zapi.go (renamed from zebra/zapi.go)2
-rw-r--r--internal/pkg/zebra/zapi_bsd.go (renamed from zebra/zapi_bsd.go)0
-rw-r--r--internal/pkg/zebra/zapi_darwin.go (renamed from zebra/zapi_darwin.go)0
-rw-r--r--internal/pkg/zebra/zapi_linux.go (renamed from zebra/zapi_linux.go)0
-rw-r--r--internal/pkg/zebra/zapi_test.go (renamed from zebra/zapi_test.go)0
-rw-r--r--internal/pkg/zebra/zapi_windows.go (renamed from zebra/zapi_windows.go)0
-rw-r--r--pkg/packet/bgp/bgp.go (renamed from packet/bgp/bgp.go)0
-rw-r--r--pkg/packet/bgp/bgp_race_test.go (renamed from packet/bgp/bgp_race_test.go)0
-rw-r--r--pkg/packet/bgp/bgp_test.go (renamed from packet/bgp/bgp_test.go)0
-rw-r--r--pkg/packet/bgp/bgpattrtype_string.go (renamed from packet/bgp/bgpattrtype_string.go)0
-rw-r--r--pkg/packet/bgp/constant.go (renamed from packet/bgp/constant.go)0
-rw-r--r--pkg/packet/bgp/esitype_string.go (renamed from packet/bgp/esitype_string.go)0
-rw-r--r--pkg/packet/bgp/fsmstate_string.go (renamed from packet/bgp/fsmstate_string.go)0
-rw-r--r--pkg/packet/bgp/helper.go (renamed from packet/bgp/helper.go)0
-rw-r--r--pkg/packet/bgp/validate.go (renamed from packet/bgp/validate.go)0
-rw-r--r--pkg/packet/bgp/validate_test.go (renamed from packet/bgp/validate_test.go)0
-rw-r--r--pkg/packet/bmp/bmp.go (renamed from packet/bmp/bmp.go)3
-rw-r--r--pkg/packet/bmp/bmp_test.go (renamed from packet/bmp/bmp_test.go)6
-rw-r--r--pkg/packet/mrt/mrt.go (renamed from packet/mrt/mrt.go)2
-rw-r--r--pkg/packet/mrt/mrt_test.go (renamed from packet/mrt/mrt_test.go)5
-rw-r--r--pkg/packet/rtr/rtr.go (renamed from packet/rtr/rtr.go)0
-rw-r--r--pkg/packet/rtr/rtr_test.go (renamed from packet/rtr/rtr_test.go)0
-rw-r--r--pkg/server/bmp.go (renamed from server/bmp.go)8
-rw-r--r--pkg/server/collector.go (renamed from server/collector.go)7
-rw-r--r--pkg/server/fsm.go (renamed from server/fsm.go)10
-rw-r--r--pkg/server/fsm_test.go (renamed from server/fsm_test.go)7
-rw-r--r--pkg/server/grpc_server.go (renamed from server/grpc_server.go)8
-rw-r--r--pkg/server/mrt.go (renamed from server/mrt.go)10
-rw-r--r--pkg/server/peer.go (renamed from server/peer.go)8
-rw-r--r--pkg/server/rpki.go (renamed from server/rpki.go)10
-rw-r--r--pkg/server/rpki_test.go (renamed from server/rpki_test.go)9
-rw-r--r--pkg/server/server.go (renamed from server/server.go)8
-rw-r--r--pkg/server/server_test.go (renamed from server/server_test.go)9
-rw-r--r--pkg/server/sockopt.go (renamed from server/sockopt.go)0
-rw-r--r--pkg/server/sockopt_bsd.go (renamed from server/sockopt_bsd.go)0
-rw-r--r--pkg/server/sockopt_darwin.go (renamed from server/sockopt_darwin.go)0
-rw-r--r--pkg/server/sockopt_linux.go (renamed from server/sockopt_linux.go)0
-rw-r--r--pkg/server/sockopt_linux_test.go (renamed from server/sockopt_linux_test.go)0
-rw-r--r--pkg/server/sockopt_openbsd.go (renamed from server/sockopt_openbsd.go)0
-rw-r--r--pkg/server/sockopt_stub.go (renamed from server/sockopt_stub.go)0
-rw-r--r--pkg/server/util.go (renamed from server/util.go)2
-rw-r--r--pkg/server/zclient.go (renamed from server/zclient.go)8
-rw-r--r--pkg/server/zclient_test.go (renamed from server/zclient_test.go)4
-rw-r--r--test/lib/base.py2
-rw-r--r--tools/config/example_toml.go3
-rw-r--r--tools/contrib/centos/README.md (renamed from contrib/centos/README.md)0
-rwxr-xr-xtools/contrib/centos/add_gobgpd_account.sh (renamed from contrib/centos/add_gobgpd_account.sh)0
-rw-r--r--tools/contrib/centos/gobgpd.service (renamed from contrib/centos/gobgpd.service)0
-rw-r--r--tools/contrib/ubuntu/gobgpd.conf (renamed from contrib/ubuntu/gobgpd.conf)0
-rw-r--r--tools/route-server/quagga-rsconfig.go2
111 files changed, 153 insertions, 154 deletions
diff --git a/.gitignore b/.gitignore
index 80a79df2..45ba1ac4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,8 +3,8 @@
*.a
*.so
*.pyc
-gobgp/gobgp
-gobgpd/gobgpd
+cmd/gobgp/gobgp
+cmd/gobgpd/gobgpd
# Folders
_obj
diff --git a/.goreleaser.yml b/.goreleaser.yml
index 69937e1b..7ec89d72 100644
--- a/.goreleaser.yml
+++ b/.goreleaser.yml
@@ -2,7 +2,7 @@
# .goreleaser.yml
# Build customization
builds:
- - main: ./gobgp/
+ - main: ./cmd/gobgp/
binary: gobgp
goos:
- linux
@@ -12,7 +12,7 @@ builds:
- arm
- arm64
- - main: ./gobgpd/
+ - main: ./cmd/gobgpd/
binary: gobgpd
goos:
- linux
diff --git a/.travis.yml b/.travis.yml
index 3ed57bc3..428513d8 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -9,13 +9,13 @@ _unittest: &_unittest
<<: *_dep_ensure
script:
- go test $(go list ./... | grep -v '/vendor/') -timeout 120s
- - if [ "$(go env GOARCH)" = "amd64" ]; then go test -race github.com/osrg/gobgp/packet/bgp -run ^Test_RaceCondition$; else echo 'skip'; fi
+ - if [ "$(go env GOARCH)" = "amd64" ]; then go test -race github.com/osrg/gobgp/pkg/packet/bgp -run ^Test_RaceCondition$; else echo 'skip'; fi
_build: &_build
<<: *_dep_ensure
script:
- - go build -o ./gobgp/gobgp ./gobgp/
- - go build -o ./gobgpd/gobgpd ./gobgpd/
+ - go build -o ./cmd/gobgp/gobgp ./cmd/gobgp/
+ - go build -o ./cmd/gobgpd/gobgpd ./cmd/gobgpd/
_node_js: &_node_js
language: node_js
@@ -114,10 +114,10 @@ matrix:
- test -z "$(go fmt $(go list ./... | grep -v '/vendor/'))"
- test -z "$(go vet $(go list ./... | grep -v '/vendor/'))"
- megacheck $(go list ./... | grep -v '/vendor/')
- - <<: *_dep_ensure
- env:
- - DESCRIPTION="build_embeded_go.py"
- script: python test/scenario_test/ci-scripts/build_embeded_go.py docs/sources/lib.md
+# - <<: *_dep_ensure
+# env:
+# - DESCRIPTION="build_embeded_go.py"
+# script: python test/scenario_test/ci-scripts/build_embeded_go.py docs/sources/lib.md
#
# Docker
#
diff --git a/api/attribute.go b/api/attribute.go
index 65ca6a4f..c4ac1375 100644
--- a/api/attribute.go
+++ b/api/attribute.go
@@ -22,9 +22,8 @@ import (
"github.com/golang/protobuf/proto"
"github.com/golang/protobuf/ptypes"
"github.com/golang/protobuf/ptypes/any"
+ "github.com/osrg/gobgp/pkg/packet/bgp"
log "github.com/sirupsen/logrus"
-
- "github.com/osrg/gobgp/packet/bgp"
)
func NewOriginAttributeFromNative(a *bgp.PathAttributeOrigin) *OriginAttribute {
diff --git a/api/attribute_test.go b/api/attribute_test.go
index 271b0191..72b20bf1 100644
--- a/api/attribute_test.go
+++ b/api/attribute_test.go
@@ -19,10 +19,9 @@ import (
"net"
"testing"
- "github.com/osrg/gobgp/packet/bgp"
-
"github.com/golang/protobuf/ptypes"
"github.com/golang/protobuf/ptypes/any"
+ "github.com/osrg/gobgp/pkg/packet/bgp"
"github.com/stretchr/testify/assert"
)
diff --git a/api/capability.go b/api/capability.go
index 80e16c6f..15231bbb 100644
--- a/api/capability.go
+++ b/api/capability.go
@@ -21,8 +21,7 @@ import (
proto "github.com/golang/protobuf/proto"
"github.com/golang/protobuf/ptypes"
"github.com/golang/protobuf/ptypes/any"
-
- "github.com/osrg/gobgp/packet/bgp"
+ "github.com/osrg/gobgp/pkg/packet/bgp"
)
func NewMultiProtocolCapability(a *bgp.CapMultiProtocol) *MultiProtocolCapability {
diff --git a/api/capability_test.go b/api/capability_test.go
index e092c836..a0c34db1 100644
--- a/api/capability_test.go
+++ b/api/capability_test.go
@@ -18,9 +18,8 @@ package gobgpapi
import (
"testing"
+ "github.com/osrg/gobgp/pkg/packet/bgp"
"github.com/stretchr/testify/assert"
-
- "github.com/osrg/gobgp/packet/bgp"
)
func Test_MultiProtocolCapability(t *testing.T) {
diff --git a/api/util.go b/api/util.go
index b77b35ec..c06484c0 100644
--- a/api/util.go
+++ b/api/util.go
@@ -20,7 +20,7 @@ import (
"net"
"time"
- "github.com/osrg/gobgp/packet/bgp"
+ "github.com/osrg/gobgp/pkg/packet/bgp"
)
func getNLRI(family bgp.RouteFamily, buf []byte) (bgp.AddrPrefixInterface, error) {
diff --git a/gobgp/cmd/bmp.go b/cmd/gobgp/cmd/bmp.go
index f06268a1..6de8eac4 100644
--- a/gobgp/cmd/bmp.go
+++ b/cmd/gobgp/cmd/bmp.go
@@ -20,10 +20,9 @@ import (
"net"
"strconv"
+ "github.com/osrg/gobgp/internal/pkg/config"
+ "github.com/osrg/gobgp/pkg/packet/bmp"
"github.com/spf13/cobra"
-
- "github.com/osrg/gobgp/config"
- "github.com/osrg/gobgp/packet/bmp"
)
func modBmpServer(cmdType string, args []string) error {
diff --git a/gobgp/cmd/common.go b/cmd/gobgp/cmd/common.go
index 94b5d8ad..fbd75767 100644
--- a/gobgp/cmd/common.go
+++ b/cmd/gobgp/cmd/common.go
@@ -30,9 +30,9 @@ import (
"google.golang.org/grpc/credentials"
api "github.com/osrg/gobgp/api"
- cli "github.com/osrg/gobgp/client"
- "github.com/osrg/gobgp/config"
- "github.com/osrg/gobgp/packet/bgp"
+ cli "github.com/osrg/gobgp/internal/pkg/client"
+ "github.com/osrg/gobgp/internal/pkg/config"
+ "github.com/osrg/gobgp/pkg/packet/bgp"
)
const (
diff --git a/gobgp/cmd/common_test.go b/cmd/gobgp/cmd/common_test.go
index d7bb87b2..d7bb87b2 100644
--- a/gobgp/cmd/common_test.go
+++ b/cmd/gobgp/cmd/common_test.go
diff --git a/gobgp/cmd/global.go b/cmd/gobgp/cmd/global.go
index 809a4b2e..4559f4ac 100644
--- a/gobgp/cmd/global.go
+++ b/cmd/gobgp/cmd/global.go
@@ -28,9 +28,10 @@ import (
"github.com/spf13/cobra"
api "github.com/osrg/gobgp/api"
- "github.com/osrg/gobgp/config"
- "github.com/osrg/gobgp/packet/bgp"
- "github.com/osrg/gobgp/table"
+ "github.com/osrg/gobgp/internal/pkg/config"
+ "github.com/osrg/gobgp/internal/pkg/table"
+
+ "github.com/osrg/gobgp/pkg/packet/bgp"
)
type ExtCommType int
diff --git a/gobgp/cmd/global_test.go b/cmd/gobgp/cmd/global_test.go
index 1be0a561..7aecb904 100644
--- a/gobgp/cmd/global_test.go
+++ b/cmd/gobgp/cmd/global_test.go
@@ -19,9 +19,8 @@ import (
"strings"
"testing"
+ "github.com/osrg/gobgp/pkg/packet/bgp"
"github.com/stretchr/testify/assert"
-
- "github.com/osrg/gobgp/packet/bgp"
)
func Test_ParsePath(t *testing.T) {
diff --git a/gobgp/cmd/monitor.go b/cmd/gobgp/cmd/monitor.go
index af91faf3..6b07eb2d 100644
--- a/gobgp/cmd/monitor.go
+++ b/cmd/gobgp/cmd/monitor.go
@@ -24,7 +24,7 @@ import (
"github.com/spf13/cobra"
api "github.com/osrg/gobgp/api"
- "github.com/osrg/gobgp/packet/bgp"
+ "github.com/osrg/gobgp/pkg/packet/bgp"
)
func makeMonitorRouteArgs(p *api.Path, showIdentifier bgp.BGPAddPathMode) []interface{} {
diff --git a/gobgp/cmd/mrt.go b/cmd/gobgp/cmd/mrt.go
index cef4f1a0..32c4fc9b 100644
--- a/gobgp/cmd/mrt.go
+++ b/cmd/gobgp/cmd/mrt.go
@@ -25,8 +25,8 @@ import (
"github.com/spf13/cobra"
api "github.com/osrg/gobgp/api"
- "github.com/osrg/gobgp/packet/bgp"
- "github.com/osrg/gobgp/packet/mrt"
+ "github.com/osrg/gobgp/pkg/packet/bgp"
+ "github.com/osrg/gobgp/pkg/packet/mrt"
)
func injectMrt() error {
diff --git a/gobgp/cmd/neighbor.go b/cmd/gobgp/cmd/neighbor.go
index c0642c26..c6dd8be6 100644
--- a/gobgp/cmd/neighbor.go
+++ b/cmd/gobgp/cmd/neighbor.go
@@ -27,10 +27,9 @@ import (
"github.com/spf13/cobra"
- "github.com/osrg/gobgp/config"
- "github.com/osrg/gobgp/packet/bgp"
-
api "github.com/osrg/gobgp/api"
+ "github.com/osrg/gobgp/internal/pkg/config"
+ "github.com/osrg/gobgp/pkg/packet/bgp"
)
// used in showRoute() to determine the width of each column
diff --git a/gobgp/cmd/policy.go b/cmd/gobgp/cmd/policy.go
index ebc2da31..7faa8648 100644
--- a/gobgp/cmd/policy.go
+++ b/cmd/gobgp/cmd/policy.go
@@ -27,8 +27,8 @@ import (
"github.com/spf13/cobra"
api "github.com/osrg/gobgp/api"
- "github.com/osrg/gobgp/config"
- "github.com/osrg/gobgp/packet/bgp"
+ "github.com/osrg/gobgp/internal/pkg/config"
+ "github.com/osrg/gobgp/pkg/packet/bgp"
)
var (
diff --git a/gobgp/cmd/root.go b/cmd/gobgp/cmd/root.go
index cfa84661..90df5ee4 100644
--- a/gobgp/cmd/root.go
+++ b/cmd/gobgp/cmd/root.go
@@ -20,7 +20,7 @@ import (
"net/http"
_ "net/http/pprof"
- cli "github.com/osrg/gobgp/client"
+ cli "github.com/osrg/gobgp/internal/pkg/client"
"github.com/spf13/cobra"
)
diff --git a/gobgp/cmd/rpki.go b/cmd/gobgp/cmd/rpki.go
index aed144e2..853892d4 100644
--- a/gobgp/cmd/rpki.go
+++ b/cmd/gobgp/cmd/rpki.go
@@ -20,7 +20,7 @@ import (
"net"
"time"
- "github.com/osrg/gobgp/packet/bgp"
+ "github.com/osrg/gobgp/pkg/packet/bgp"
"github.com/spf13/cobra"
)
diff --git a/gobgp/cmd/rpki_test.go b/cmd/gobgp/cmd/rpki_test.go
index 540f1e89..af4a9cd1 100644
--- a/gobgp/cmd/rpki_test.go
+++ b/cmd/gobgp/cmd/rpki_test.go
@@ -19,10 +19,9 @@ import (
"testing"
"time"
+ "github.com/osrg/gobgp/internal/pkg/config"
+ "github.com/osrg/gobgp/pkg/server"
"github.com/stretchr/testify/assert"
-
- "github.com/osrg/gobgp/config"
- "github.com/osrg/gobgp/server"
)
func TestShowRPKITable(test *testing.T) {
diff --git a/gobgp/cmd/vrf.go b/cmd/gobgp/cmd/vrf.go
index 84cb20fd..fd55dc0a 100644
--- a/gobgp/cmd/vrf.go
+++ b/cmd/gobgp/cmd/vrf.go
@@ -23,7 +23,7 @@ import (
"strings"
api "github.com/osrg/gobgp/api"
- "github.com/osrg/gobgp/packet/bgp"
+ "github.com/osrg/gobgp/pkg/packet/bgp"
"github.com/golang/protobuf/ptypes/any"
"github.com/spf13/cobra"
diff --git a/gobgp/lib/lib.go b/cmd/gobgp/lib/lib.go
index ee71a859..ee71a859 100644
--- a/gobgp/lib/lib.go
+++ b/cmd/gobgp/lib/lib.go
diff --git a/gobgp/lib/path.go b/cmd/gobgp/lib/path.go
index 863a2595..130f5444 100644
--- a/gobgp/lib/path.go
+++ b/cmd/gobgp/lib/path.go
@@ -36,8 +36,8 @@ import (
"encoding/json"
"strings"
- "github.com/osrg/gobgp/gobgp/cmd"
- "github.com/osrg/gobgp/packet/bgp"
+ "github.com/osrg/gobgp/cmd/gobgp/cmd"
+ "github.com/osrg/gobgp/pkg/packet/bgp"
)
//export get_route_family
diff --git a/gobgp/main.go b/cmd/gobgp/main.go
index 2d821b0a..b3ae82f6 100644
--- a/gobgp/main.go
+++ b/cmd/gobgp/main.go
@@ -17,9 +17,10 @@ package main
import (
"fmt"
- "github.com/osrg/gobgp/gobgp/cmd"
- "google.golang.org/grpc"
"os"
+
+ "github.com/osrg/gobgp/cmd/gobgp/cmd"
+ "google.golang.org/grpc"
)
var version = "master"
diff --git a/gobgpd/main.go b/cmd/gobgpd/main.go
index 3b0f1da2..6f1a364d 100644
--- a/gobgpd/main.go
+++ b/cmd/gobgpd/main.go
@@ -35,10 +35,10 @@ import (
"google.golang.org/grpc/credentials"
api "github.com/osrg/gobgp/api"
- "github.com/osrg/gobgp/config"
- "github.com/osrg/gobgp/packet/bgp"
- "github.com/osrg/gobgp/server"
- "github.com/osrg/gobgp/table"
+ "github.com/osrg/gobgp/internal/pkg/config"
+ "github.com/osrg/gobgp/internal/pkg/table"
+ "github.com/osrg/gobgp/pkg/packet/bgp"
+ "github.com/osrg/gobgp/pkg/server"
)
var version = "master"
diff --git a/gobgpd/util.go b/cmd/gobgpd/util.go
index 1b7885b8..1b7885b8 100644
--- a/gobgpd/util.go
+++ b/cmd/gobgpd/util.go
diff --git a/gobgpd/util_windows.go b/cmd/gobgpd/util_windows.go
index 56c5bc2f..56c5bc2f 100644
--- a/gobgpd/util_windows.go
+++ b/cmd/gobgpd/util_windows.go
diff --git a/client/client.go b/internal/pkg/client/client.go
index d159ffed..28adfd62 100644
--- a/client/client.go
+++ b/internal/pkg/client/client.go
@@ -27,9 +27,9 @@ import (
"google.golang.org/grpc"
api "github.com/osrg/gobgp/api"
- "github.com/osrg/gobgp/config"
- "github.com/osrg/gobgp/packet/bgp"
- "github.com/osrg/gobgp/server"
+ "github.com/osrg/gobgp/internal/pkg/config"
+ "github.com/osrg/gobgp/pkg/packet/bgp"
+ "github.com/osrg/gobgp/pkg/server"
)
type Client struct {
diff --git a/client/client_test.go b/internal/pkg/client/client_test.go
index 63f430fb..a737172d 100644
--- a/client/client_test.go
+++ b/internal/pkg/client/client_test.go
@@ -19,8 +19,8 @@ import (
"testing"
"time"
- "github.com/osrg/gobgp/config"
- "github.com/osrg/gobgp/server"
+ "github.com/osrg/gobgp/internal/pkg/config"
+ "github.com/osrg/gobgp/pkg/server"
"github.com/stretchr/testify/assert"
)
diff --git a/config/bgp_configs.go b/internal/pkg/config/bgp_configs.go
index 8268769e..5c3cff97 100644
--- a/config/bgp_configs.go
+++ b/internal/pkg/config/bgp_configs.go
@@ -21,7 +21,7 @@ package config
import (
"fmt"
- "github.com/osrg/gobgp/packet/bgp"
+ "github.com/osrg/gobgp/pkg/packet/bgp"
)
func mapkey(index int, name string) string {
diff --git a/config/bgp_configs_test.go b/internal/pkg/config/bgp_configs_test.go
index 7a98e1ae..6d6853a7 100644
--- a/config/bgp_configs_test.go
+++ b/internal/pkg/config/bgp_configs_test.go
@@ -97,7 +97,7 @@ func TestConfigExample(t *testing.T) {
assert := assert.New(t)
_, f, _, _ := runtime.Caller(0)
- fileMd := path.Join(path.Dir(f), "../docs/sources/configuration.md")
+ fileMd := path.Join(path.Dir(f), "../../../docs/sources/configuration.md")
fileToml := "/tmp/gobgpd.example.toml"
assert.NoError(extractTomlFromMarkdown(fileMd, fileToml))
defer os.Remove(fileToml)
diff --git a/config/default.go b/internal/pkg/config/default.go
index a6f7fc91..6ab1eddc 100644
--- a/config/default.go
+++ b/internal/pkg/config/default.go
@@ -8,11 +8,10 @@ import (
"reflect"
"strconv"
+ "github.com/osrg/gobgp/pkg/packet/bgp"
+ "github.com/osrg/gobgp/pkg/packet/bmp"
+ "github.com/osrg/gobgp/pkg/packet/rtr"
"github.com/spf13/viper"
-
- "github.com/osrg/gobgp/packet/bgp"
- "github.com/osrg/gobgp/packet/bmp"
- "github.com/osrg/gobgp/packet/rtr"
)
const (
diff --git a/config/default_linux.go b/internal/pkg/config/default_linux.go
index 8cfcc501..8cfcc501 100644
--- a/config/default_linux.go
+++ b/internal/pkg/config/default_linux.go
diff --git a/config/default_nonlinux.go b/internal/pkg/config/default_nonlinux.go
index fe4705a6..fe4705a6 100644
--- a/config/default_nonlinux.go
+++ b/internal/pkg/config/default_nonlinux.go
diff --git a/config/serve.go b/internal/pkg/config/serve.go
index 6b09af6e..6b09af6e 100644
--- a/config/serve.go
+++ b/internal/pkg/config/serve.go
diff --git a/config/util.go b/internal/pkg/config/util.go
index e857b98b..591252b4 100644
--- a/config/util.go
+++ b/internal/pkg/config/util.go
@@ -22,7 +22,7 @@ import (
"regexp"
"strconv"
- "github.com/osrg/gobgp/packet/bgp"
+ "github.com/osrg/gobgp/pkg/packet/bgp"
)
// Returns config file type by retrieving extension from the given path.
diff --git a/config/util_test.go b/internal/pkg/config/util_test.go
index a34b02f4..a34b02f4 100644
--- a/config/util_test.go
+++ b/internal/pkg/config/util_test.go
diff --git a/table/adj.go b/internal/pkg/table/adj.go
index a0148605..95fbf6af 100644
--- a/table/adj.go
+++ b/internal/pkg/table/adj.go
@@ -18,7 +18,7 @@ package table
import (
"fmt"
- "github.com/osrg/gobgp/packet/bgp"
+ "github.com/osrg/gobgp/pkg/packet/bgp"
)
type AdjRib struct {
diff --git a/table/adj_test.go b/internal/pkg/table/adj_test.go
index 45ebcb48..ac4fc5a0 100644
--- a/table/adj_test.go
+++ b/internal/pkg/table/adj_test.go
@@ -19,7 +19,8 @@ import (
"testing"
"time"
- "github.com/osrg/gobgp/packet/bgp"
+ "github.com/osrg/gobgp/pkg/packet/bgp"
+
"github.com/stretchr/testify/assert"
)
diff --git a/table/destination.go b/internal/pkg/table/destination.go
index 49dceaa7..fa61572e 100644
--- a/table/destination.go
+++ b/internal/pkg/table/destination.go
@@ -23,10 +23,10 @@ import (
"net"
"sort"
- log "github.com/sirupsen/logrus"
+ "github.com/osrg/gobgp/internal/pkg/config"
+ "github.com/osrg/gobgp/pkg/packet/bgp"
- "github.com/osrg/gobgp/config"
- "github.com/osrg/gobgp/packet/bgp"
+ log "github.com/sirupsen/logrus"
)
var SelectionOptions config.RouteSelectionOptionsConfig
diff --git a/table/destination_test.go b/internal/pkg/table/destination_test.go
index b5a42007..110278fb 100644
--- a/table/destination_test.go
+++ b/internal/pkg/table/destination_test.go
@@ -22,7 +22,8 @@ import (
"testing"
"time"
- "github.com/osrg/gobgp/packet/bgp"
+ "github.com/osrg/gobgp/pkg/packet/bgp"
+
"github.com/stretchr/testify/assert"
)
diff --git a/table/message.go b/internal/pkg/table/message.go
index 8b9a4440..31b90596 100644
--- a/table/message.go
+++ b/internal/pkg/table/message.go
@@ -19,7 +19,7 @@ import (
"bytes"
"reflect"
- "github.com/osrg/gobgp/packet/bgp"
+ "github.com/osrg/gobgp/pkg/packet/bgp"
log "github.com/sirupsen/logrus"
)
diff --git a/table/message_test.go b/internal/pkg/table/message_test.go
index 11c8dd19..28a380fe 100644
--- a/table/message_test.go
+++ b/internal/pkg/table/message_test.go
@@ -21,7 +21,7 @@ import (
"testing"
"time"
- "github.com/osrg/gobgp/packet/bgp"
+ "github.com/osrg/gobgp/pkg/packet/bgp"
"github.com/stretchr/testify/assert"
)
diff --git a/table/path.go b/internal/pkg/table/path.go
index 1cb81a91..14bbe6ae 100644
--- a/table/path.go
+++ b/internal/pkg/table/path.go
@@ -24,10 +24,10 @@ import (
"sort"
"time"
- log "github.com/sirupsen/logrus"
+ "github.com/osrg/gobgp/internal/pkg/config"
+ "github.com/osrg/gobgp/pkg/packet/bgp"
- "github.com/osrg/gobgp/config"
- "github.com/osrg/gobgp/packet/bgp"
+ log "github.com/sirupsen/logrus"
)
const (
diff --git a/table/path_test.go b/internal/pkg/table/path_test.go
index 768b76bf..449c4a8e 100644
--- a/table/path_test.go
+++ b/internal/pkg/table/path_test.go
@@ -5,8 +5,9 @@ import (
"testing"
"time"
- "github.com/osrg/gobgp/config"
- "github.com/osrg/gobgp/packet/bgp"
+ "github.com/osrg/gobgp/internal/pkg/config"
+ "github.com/osrg/gobgp/pkg/packet/bgp"
+
"github.com/stretchr/testify/assert"
)
diff --git a/table/policy.go b/internal/pkg/table/policy.go
index 55d2fc23..23c2110c 100644
--- a/table/policy.go
+++ b/internal/pkg/table/policy.go
@@ -27,8 +27,8 @@ import (
"strings"
"sync"
- "github.com/osrg/gobgp/config"
- "github.com/osrg/gobgp/packet/bgp"
+ "github.com/osrg/gobgp/internal/pkg/config"
+ "github.com/osrg/gobgp/pkg/packet/bgp"
radix "github.com/armon/go-radix"
log "github.com/sirupsen/logrus"
diff --git a/table/policy_test.go b/internal/pkg/table/policy_test.go
index 858e1098..7f1a1dd9 100644
--- a/table/policy_test.go
+++ b/internal/pkg/table/policy_test.go
@@ -24,8 +24,8 @@ import (
"testing"
"time"
- "github.com/osrg/gobgp/config"
- "github.com/osrg/gobgp/packet/bgp"
+ "github.com/osrg/gobgp/internal/pkg/config"
+ "github.com/osrg/gobgp/pkg/packet/bgp"
log "github.com/sirupsen/logrus"
"github.com/stretchr/testify/assert"
diff --git a/table/roa.go b/internal/pkg/table/roa.go
index fe08fe54..fe08fe54 100644
--- a/table/roa.go
+++ b/internal/pkg/table/roa.go
diff --git a/table/table.go b/internal/pkg/table/table.go
index 82259b0f..bcde936b 100644
--- a/table/table.go
+++ b/internal/pkg/table/table.go
@@ -22,7 +22,7 @@ import (
"unsafe"
"github.com/armon/go-radix"
- "github.com/osrg/gobgp/packet/bgp"
+ "github.com/osrg/gobgp/pkg/packet/bgp"
log "github.com/sirupsen/logrus"
)
diff --git a/table/table_manager.go b/internal/pkg/table/table_manager.go
index 26581cea..e10f4d6a 100644
--- a/table/table_manager.go
+++ b/internal/pkg/table/table_manager.go
@@ -21,10 +21,10 @@ import (
"net"
"time"
+ "github.com/osrg/gobgp/pkg/packet/bgp"
+
farm "github.com/dgryski/go-farm"
log "github.com/sirupsen/logrus"
-
- "github.com/osrg/gobgp/packet/bgp"
)
const (
diff --git a/table/table_manager_test.go b/internal/pkg/table/table_manager_test.go
index 11a7b066..67c26c11 100644
--- a/table/table_manager_test.go
+++ b/internal/pkg/table/table_manager_test.go
@@ -21,7 +21,8 @@ import (
"testing"
"time"
- "github.com/osrg/gobgp/packet/bgp"
+ "github.com/osrg/gobgp/pkg/packet/bgp"
+
"github.com/stretchr/testify/assert"
)
diff --git a/table/table_test.go b/internal/pkg/table/table_test.go
index 6228b995..1e91aa6b 100644
--- a/table/table_test.go
+++ b/internal/pkg/table/table_test.go
@@ -19,7 +19,8 @@ import (
"testing"
"time"
- "github.com/osrg/gobgp/packet/bgp"
+ "github.com/osrg/gobgp/pkg/packet/bgp"
+
"github.com/stretchr/testify/assert"
)
diff --git a/table/vrf.go b/internal/pkg/table/vrf.go
index f58bee2a..053f85ce 100644
--- a/table/vrf.go
+++ b/internal/pkg/table/vrf.go
@@ -16,7 +16,7 @@
package table
import (
- "github.com/osrg/gobgp/packet/bgp"
+ "github.com/osrg/gobgp/pkg/packet/bgp"
)
type Vrf struct {
diff --git a/zebra/afi_string.go b/internal/pkg/zebra/afi_string.go
index 6c07a09d..6c07a09d 100644
--- a/zebra/afi_string.go
+++ b/internal/pkg/zebra/afi_string.go
diff --git a/zebra/api_type_string.go b/internal/pkg/zebra/api_type_string.go
index e97059b1..e97059b1 100644
--- a/zebra/api_type_string.go
+++ b/internal/pkg/zebra/api_type_string.go
diff --git a/zebra/link_type_string.go b/internal/pkg/zebra/link_type_string.go
index 9db8544b..9db8544b 100644
--- a/zebra/link_type_string.go
+++ b/internal/pkg/zebra/link_type_string.go
diff --git a/zebra/nexthop_flag_string.go b/internal/pkg/zebra/nexthop_flag_string.go
index 38f08b8a..38f08b8a 100644
--- a/zebra/nexthop_flag_string.go
+++ b/internal/pkg/zebra/nexthop_flag_string.go
diff --git a/zebra/ptm_enable_string.go b/internal/pkg/zebra/ptm_enable_string.go
index d750542e..d750542e 100644
--- a/zebra/ptm_enable_string.go
+++ b/internal/pkg/zebra/ptm_enable_string.go
diff --git a/zebra/ptm_status_string.go b/internal/pkg/zebra/ptm_status_string.go
index 464233b7..464233b7 100644
--- a/zebra/ptm_status_string.go
+++ b/internal/pkg/zebra/ptm_status_string.go
diff --git a/zebra/route_type_string.go b/internal/pkg/zebra/route_type_string.go
index e2ad6c97..e2ad6c97 100644
--- a/zebra/route_type_string.go
+++ b/internal/pkg/zebra/route_type_string.go
diff --git a/zebra/safi_string.go b/internal/pkg/zebra/safi_string.go
index ab491cb6..ab491cb6 100644
--- a/zebra/safi_string.go
+++ b/internal/pkg/zebra/safi_string.go
diff --git a/zebra/zapi.go b/internal/pkg/zebra/zapi.go
index 667cfcd9..eb443d05 100644
--- a/zebra/zapi.go
+++ b/internal/pkg/zebra/zapi.go
@@ -25,7 +25,7 @@ import (
log "github.com/sirupsen/logrus"
- "github.com/osrg/gobgp/packet/bgp"
+ "github.com/osrg/gobgp/pkg/packet/bgp"
)
const (
diff --git a/zebra/zapi_bsd.go b/internal/pkg/zebra/zapi_bsd.go
index 8960e796..8960e796 100644
--- a/zebra/zapi_bsd.go
+++ b/internal/pkg/zebra/zapi_bsd.go
diff --git a/zebra/zapi_darwin.go b/internal/pkg/zebra/zapi_darwin.go
index a2536913..a2536913 100644
--- a/zebra/zapi_darwin.go
+++ b/internal/pkg/zebra/zapi_darwin.go
diff --git a/zebra/zapi_linux.go b/internal/pkg/zebra/zapi_linux.go
index 66fccb74..66fccb74 100644
--- a/zebra/zapi_linux.go
+++ b/internal/pkg/zebra/zapi_linux.go
diff --git a/zebra/zapi_test.go b/internal/pkg/zebra/zapi_test.go
index 9fda5416..9fda5416 100644
--- a/zebra/zapi_test.go
+++ b/internal/pkg/zebra/zapi_test.go
diff --git a/zebra/zapi_windows.go b/internal/pkg/zebra/zapi_windows.go
index d55525db..d55525db 100644
--- a/zebra/zapi_windows.go
+++ b/internal/pkg/zebra/zapi_windows.go
diff --git a/packet/bgp/bgp.go b/pkg/packet/bgp/bgp.go
index 01251167..01251167 100644
--- a/packet/bgp/bgp.go
+++ b/pkg/packet/bgp/bgp.go
diff --git a/packet/bgp/bgp_race_test.go b/pkg/packet/bgp/bgp_race_test.go
index 08038200..08038200 100644
--- a/packet/bgp/bgp_race_test.go
+++ b/pkg/packet/bgp/bgp_race_test.go
diff --git a/packet/bgp/bgp_test.go b/pkg/packet/bgp/bgp_test.go
index a4801f27..a4801f27 100644
--- a/packet/bgp/bgp_test.go
+++ b/pkg/packet/bgp/bgp_test.go
diff --git a/packet/bgp/bgpattrtype_string.go b/pkg/packet/bgp/bgpattrtype_string.go
index 1a2cf1d0..1a2cf1d0 100644
--- a/packet/bgp/bgpattrtype_string.go
+++ b/pkg/packet/bgp/bgpattrtype_string.go
diff --git a/packet/bgp/constant.go b/pkg/packet/bgp/constant.go
index 5ea7b414..5ea7b414 100644
--- a/packet/bgp/constant.go
+++ b/pkg/packet/bgp/constant.go
diff --git a/packet/bgp/esitype_string.go b/pkg/packet/bgp/esitype_string.go
index 5651bda8..5651bda8 100644
--- a/packet/bgp/esitype_string.go
+++ b/pkg/packet/bgp/esitype_string.go
diff --git a/packet/bgp/fsmstate_string.go b/pkg/packet/bgp/fsmstate_string.go
index 4416afc1..4416afc1 100644
--- a/packet/bgp/fsmstate_string.go
+++ b/pkg/packet/bgp/fsmstate_string.go
diff --git a/packet/bgp/helper.go b/pkg/packet/bgp/helper.go
index 34648b2d..34648b2d 100644
--- a/packet/bgp/helper.go
+++ b/pkg/packet/bgp/helper.go
diff --git a/packet/bgp/validate.go b/pkg/packet/bgp/validate.go
index 60cf26e4..60cf26e4 100644
--- a/packet/bgp/validate.go
+++ b/pkg/packet/bgp/validate.go
diff --git a/packet/bgp/validate_test.go b/pkg/packet/bgp/validate_test.go
index 8bdec550..8bdec550 100644
--- a/packet/bgp/validate_test.go
+++ b/pkg/packet/bgp/validate_test.go
diff --git a/packet/bmp/bmp.go b/pkg/packet/bmp/bmp.go
index eb2ce185..535ef4b0 100644
--- a/packet/bmp/bmp.go
+++ b/pkg/packet/bmp/bmp.go
@@ -18,9 +18,10 @@ package bmp
import (
"encoding/binary"
"fmt"
- "github.com/osrg/gobgp/packet/bgp"
"math"
"net"
+
+ "github.com/osrg/gobgp/pkg/packet/bgp"
)
type BMPHeader struct {
diff --git a/packet/bmp/bmp_test.go b/pkg/packet/bmp/bmp_test.go
index fde4cd0f..be99b687 100644
--- a/packet/bmp/bmp_test.go
+++ b/pkg/packet/bmp/bmp_test.go
@@ -18,11 +18,9 @@ package bmp
import (
"testing"
- "github.com/stretchr/testify/require"
-
- "github.com/osrg/gobgp/packet/bgp"
-
+ "github.com/osrg/gobgp/pkg/packet/bgp"
"github.com/stretchr/testify/assert"
+ "github.com/stretchr/testify/require"
)
func verify(t *testing.T, m1 *BMPMessage) {
diff --git a/packet/mrt/mrt.go b/pkg/packet/mrt/mrt.go
index 9c6fef6d..dc07ba9b 100644
--- a/packet/mrt/mrt.go
+++ b/pkg/packet/mrt/mrt.go
@@ -23,7 +23,7 @@ import (
"net"
"time"
- "github.com/osrg/gobgp/packet/bgp"
+ "github.com/osrg/gobgp/pkg/packet/bgp"
)
const (
diff --git a/packet/mrt/mrt_test.go b/pkg/packet/mrt/mrt_test.go
index 30edd496..8a710758 100644
--- a/packet/mrt/mrt_test.go
+++ b/pkg/packet/mrt/mrt_test.go
@@ -18,11 +18,12 @@ package mrt
import (
"bufio"
"bytes"
- "github.com/osrg/gobgp/packet/bgp"
- "github.com/stretchr/testify/assert"
"reflect"
"testing"
"time"
+
+ "github.com/osrg/gobgp/pkg/packet/bgp"
+ "github.com/stretchr/testify/assert"
)
func TestMrtHdr(t *testing.T) {
diff --git a/packet/rtr/rtr.go b/pkg/packet/rtr/rtr.go
index 902f1e62..902f1e62 100644
--- a/packet/rtr/rtr.go
+++ b/pkg/packet/rtr/rtr.go
diff --git a/packet/rtr/rtr_test.go b/pkg/packet/rtr/rtr_test.go
index 08f930b2..08f930b2 100644
--- a/packet/rtr/rtr_test.go
+++ b/pkg/packet/rtr/rtr_test.go
diff --git a/server/bmp.go b/pkg/server/bmp.go
index 91507cd3..7904fae1 100644
--- a/server/bmp.go
+++ b/pkg/server/bmp.go
@@ -21,10 +21,10 @@ import (
"strconv"
"time"
- "github.com/osrg/gobgp/config"
- "github.com/osrg/gobgp/packet/bgp"
- "github.com/osrg/gobgp/packet/bmp"
- "github.com/osrg/gobgp/table"
+ "github.com/osrg/gobgp/internal/pkg/config"
+ "github.com/osrg/gobgp/internal/pkg/table"
+ "github.com/osrg/gobgp/pkg/packet/bgp"
+ "github.com/osrg/gobgp/pkg/packet/bmp"
log "github.com/sirupsen/logrus"
)
diff --git a/server/collector.go b/pkg/server/collector.go
index 50fb72e9..c219b215 100644
--- a/server/collector.go
+++ b/pkg/server/collector.go
@@ -17,11 +17,12 @@ package server
import (
"fmt"
+ "time"
+
"github.com/influxdata/influxdb/client/v2"
- "github.com/osrg/gobgp/packet/bgp"
- "github.com/osrg/gobgp/table"
+ "github.com/osrg/gobgp/internal/pkg/table"
+ "github.com/osrg/gobgp/pkg/packet/bgp"
log "github.com/sirupsen/logrus"
- "time"
)
type Collector struct {
diff --git a/server/fsm.go b/pkg/server/fsm.go
index d65107df..855066f4 100644
--- a/server/fsm.go
+++ b/pkg/server/fsm.go
@@ -23,12 +23,12 @@ import (
"strconv"
"time"
- "github.com/osrg/gobgp/config"
- "github.com/osrg/gobgp/packet/bgp"
- "github.com/osrg/gobgp/packet/bmp"
- "github.com/osrg/gobgp/table"
-
"github.com/eapache/channels"
+ "github.com/osrg/gobgp/internal/pkg/config"
+ "github.com/osrg/gobgp/internal/pkg/table"
+ "github.com/osrg/gobgp/pkg/packet/bgp"
+ "github.com/osrg/gobgp/pkg/packet/bmp"
+
log "github.com/sirupsen/logrus"
"gopkg.in/tomb.v2"
)
diff --git a/server/fsm_test.go b/pkg/server/fsm_test.go
index 73159556..dad6563a 100644
--- a/server/fsm_test.go
+++ b/pkg/server/fsm_test.go
@@ -24,9 +24,10 @@ import (
"time"
"github.com/eapache/channels"
- "github.com/osrg/gobgp/config"
- "github.com/osrg/gobgp/packet/bgp"
- "github.com/osrg/gobgp/table"
+ "github.com/osrg/gobgp/internal/pkg/config"
+ "github.com/osrg/gobgp/internal/pkg/table"
+ "github.com/osrg/gobgp/pkg/packet/bgp"
+
log "github.com/sirupsen/logrus"
"github.com/stretchr/testify/assert"
)
diff --git a/server/grpc_server.go b/pkg/server/grpc_server.go
index 4dab8182..37b7c57b 100644
--- a/server/grpc_server.go
+++ b/pkg/server/grpc_server.go
@@ -34,10 +34,10 @@ import (
"google.golang.org/grpc"
api "github.com/osrg/gobgp/api"
- "github.com/osrg/gobgp/config"
- "github.com/osrg/gobgp/packet/bgp"
- "github.com/osrg/gobgp/table"
- "github.com/osrg/gobgp/zebra"
+ "github.com/osrg/gobgp/internal/pkg/config"
+ "github.com/osrg/gobgp/internal/pkg/table"
+ "github.com/osrg/gobgp/internal/pkg/zebra"
+ "github.com/osrg/gobgp/pkg/packet/bgp"
)
type Server struct {
diff --git a/server/mrt.go b/pkg/server/mrt.go
index 54e774d3..c654cb78 100644
--- a/server/mrt.go
+++ b/pkg/server/mrt.go
@@ -21,12 +21,12 @@ import (
"os"
"time"
- log "github.com/sirupsen/logrus"
+ "github.com/osrg/gobgp/internal/pkg/config"
+ "github.com/osrg/gobgp/internal/pkg/table"
+ "github.com/osrg/gobgp/pkg/packet/bgp"
+ "github.com/osrg/gobgp/pkg/packet/mrt"
- "github.com/osrg/gobgp/config"
- "github.com/osrg/gobgp/packet/bgp"
- "github.com/osrg/gobgp/packet/mrt"
- "github.com/osrg/gobgp/table"
+ log "github.com/sirupsen/logrus"
)
const (
diff --git a/server/peer.go b/pkg/server/peer.go
index 3a43fac9..1f3dd8d8 100644
--- a/server/peer.go
+++ b/pkg/server/peer.go
@@ -20,12 +20,12 @@ import (
"net"
"time"
+ "github.com/osrg/gobgp/internal/pkg/config"
+ "github.com/osrg/gobgp/internal/pkg/table"
+ "github.com/osrg/gobgp/pkg/packet/bgp"
+
"github.com/eapache/channels"
log "github.com/sirupsen/logrus"
-
- "github.com/osrg/gobgp/config"
- "github.com/osrg/gobgp/packet/bgp"
- "github.com/osrg/gobgp/table"
)
const (
diff --git a/server/rpki.go b/pkg/server/rpki.go
index 6356888a..606b18ab 100644
--- a/server/rpki.go
+++ b/pkg/server/rpki.go
@@ -24,14 +24,14 @@ import (
"strconv"
"time"
+ "github.com/osrg/gobgp/internal/pkg/config"
+ "github.com/osrg/gobgp/internal/pkg/table"
+ "github.com/osrg/gobgp/pkg/packet/bgp"
+ "github.com/osrg/gobgp/pkg/packet/rtr"
+
"github.com/armon/go-radix"
log "github.com/sirupsen/logrus"
"golang.org/x/net/context"
-
- "github.com/osrg/gobgp/config"
- "github.com/osrg/gobgp/packet/bgp"
- "github.com/osrg/gobgp/packet/rtr"
- "github.com/osrg/gobgp/table"
)
const (
diff --git a/server/rpki_test.go b/pkg/server/rpki_test.go
index c7c24669..0d77dbb2 100644
--- a/server/rpki_test.go
+++ b/pkg/server/rpki_test.go
@@ -21,13 +21,12 @@ import (
"strings"
"testing"
- "github.com/stretchr/testify/assert"
+ "github.com/osrg/gobgp/internal/pkg/config"
+ "github.com/osrg/gobgp/internal/pkg/table"
+ "github.com/osrg/gobgp/pkg/packet/bgp"
radix "github.com/armon/go-radix"
-
- "github.com/osrg/gobgp/config"
- "github.com/osrg/gobgp/packet/bgp"
- "github.com/osrg/gobgp/table"
+ "github.com/stretchr/testify/assert"
)
func strToASParam(str string) *bgp.PathAttributeAsPath {
diff --git a/server/server.go b/pkg/server/server.go
index 6faecba9..b00bb55d 100644
--- a/server/server.go
+++ b/pkg/server/server.go
@@ -23,13 +23,13 @@ import (
"sync"
"time"
+ "github.com/osrg/gobgp/internal/pkg/config"
+ "github.com/osrg/gobgp/internal/pkg/table"
+ "github.com/osrg/gobgp/pkg/packet/bgp"
+
"github.com/eapache/channels"
uuid "github.com/satori/go.uuid"
log "github.com/sirupsen/logrus"
-
- "github.com/osrg/gobgp/config"
- "github.com/osrg/gobgp/packet/bgp"
- "github.com/osrg/gobgp/table"
)
type TCPListener struct {
diff --git a/server/server_test.go b/pkg/server/server_test.go
index 4a6495e4..e4a5e677 100644
--- a/server/server_test.go
+++ b/pkg/server/server_test.go
@@ -22,14 +22,13 @@ import (
"testing"
"time"
- "github.com/stretchr/testify/require"
+ "github.com/osrg/gobgp/internal/pkg/config"
+ "github.com/osrg/gobgp/internal/pkg/table"
+ "github.com/osrg/gobgp/pkg/packet/bgp"
log "github.com/sirupsen/logrus"
"github.com/stretchr/testify/assert"
-
- "github.com/osrg/gobgp/config"
- "github.com/osrg/gobgp/packet/bgp"
- "github.com/osrg/gobgp/table"
+ "github.com/stretchr/testify/require"
)
func TestModPolicyAssign(t *testing.T) {
diff --git a/server/sockopt.go b/pkg/server/sockopt.go
index e1c9c467..e1c9c467 100644
--- a/server/sockopt.go
+++ b/pkg/server/sockopt.go
diff --git a/server/sockopt_bsd.go b/pkg/server/sockopt_bsd.go
index 651e4e58..651e4e58 100644
--- a/server/sockopt_bsd.go
+++ b/pkg/server/sockopt_bsd.go
diff --git a/server/sockopt_darwin.go b/pkg/server/sockopt_darwin.go
index 4bad54ff..4bad54ff 100644
--- a/server/sockopt_darwin.go
+++ b/pkg/server/sockopt_darwin.go
diff --git a/server/sockopt_linux.go b/pkg/server/sockopt_linux.go
index 9fe02ba5..9fe02ba5 100644
--- a/server/sockopt_linux.go
+++ b/pkg/server/sockopt_linux.go
diff --git a/server/sockopt_linux_test.go b/pkg/server/sockopt_linux_test.go
index a08e7fc7..a08e7fc7 100644
--- a/server/sockopt_linux_test.go
+++ b/pkg/server/sockopt_linux_test.go
diff --git a/server/sockopt_openbsd.go b/pkg/server/sockopt_openbsd.go
index f52c1447..f52c1447 100644
--- a/server/sockopt_openbsd.go
+++ b/pkg/server/sockopt_openbsd.go
diff --git a/server/sockopt_stub.go b/pkg/server/sockopt_stub.go
index 9e888dc5..9e888dc5 100644
--- a/server/sockopt_stub.go
+++ b/pkg/server/sockopt_stub.go
diff --git a/server/util.go b/pkg/server/util.go
index b122fbdb..ba6fe70a 100644
--- a/server/util.go
+++ b/pkg/server/util.go
@@ -23,7 +23,7 @@ import (
"github.com/eapache/channels"
- "github.com/osrg/gobgp/packet/bgp"
+ "github.com/osrg/gobgp/pkg/packet/bgp"
)
func cleanInfiniteChannel(ch *channels.InfiniteChannel) {
diff --git a/server/zclient.go b/pkg/server/zclient.go
index 37281f7f..3ef057ce 100644
--- a/server/zclient.go
+++ b/pkg/server/zclient.go
@@ -24,11 +24,11 @@ import (
"syscall"
"time"
- log "github.com/sirupsen/logrus"
+ "github.com/osrg/gobgp/internal/pkg/table"
+ "github.com/osrg/gobgp/internal/pkg/zebra"
+ "github.com/osrg/gobgp/pkg/packet/bgp"
- "github.com/osrg/gobgp/packet/bgp"
- "github.com/osrg/gobgp/table"
- "github.com/osrg/gobgp/zebra"
+ log "github.com/sirupsen/logrus"
)
// nexthopStateCache stores a map of nexthop IP to metric value. Especially,
diff --git a/server/zclient_test.go b/pkg/server/zclient_test.go
index 46f40539..c7868c0b 100644
--- a/server/zclient_test.go
+++ b/pkg/server/zclient_test.go
@@ -22,8 +22,8 @@ import (
"github.com/stretchr/testify/assert"
- "github.com/osrg/gobgp/table"
- "github.com/osrg/gobgp/zebra"
+ "github.com/osrg/gobgp/internal/pkg/table"
+ "github.com/osrg/gobgp/internal/pkg/zebra"
)
func Test_newPathFromIPRouteMessage(t *testing.T) {
diff --git a/test/lib/base.py b/test/lib/base.py
index 99a9e97c..6fe1a50c 100644
--- a/test/lib/base.py
+++ b/test/lib/base.py
@@ -167,7 +167,7 @@ def make_gobgp_ctn(tag='gobgp', local_gobgp_path='', from_image='osrg/quagga'):
c << 'RUN go get -u github.com/golang/dep/cmd/dep'
c << 'RUN mkdir -p /go/src/github.com/osrg/'
c << 'ADD gobgp /go/src/github.com/osrg/gobgp/'
- c << 'RUN cd /go/src/github.com/osrg/gobgp && dep ensure && go install ./gobgpd ./gobgp'
+ c << 'RUN cd /go/src/github.com/osrg/gobgp && dep ensure && go install ./cmd/gobgpd ./cmd/gobgp'
rindex = local_gobgp_path.rindex('gobgp')
if rindex < 0:
diff --git a/tools/config/example_toml.go b/tools/config/example_toml.go
index 62e6b8f6..0018f582 100644
--- a/tools/config/example_toml.go
+++ b/tools/config/example_toml.go
@@ -3,8 +3,9 @@ package main
import (
"bytes"
"fmt"
+
"github.com/BurntSushi/toml"
- "github.com/osrg/gobgp/config"
+ "github.com/osrg/gobgp/internal/pkg/config"
)
func main() {
diff --git a/contrib/centos/README.md b/tools/contrib/centos/README.md
index a8416b45..a8416b45 100644
--- a/contrib/centos/README.md
+++ b/tools/contrib/centos/README.md
diff --git a/contrib/centos/add_gobgpd_account.sh b/tools/contrib/centos/add_gobgpd_account.sh
index 05ee46fe..05ee46fe 100755
--- a/contrib/centos/add_gobgpd_account.sh
+++ b/tools/contrib/centos/add_gobgpd_account.sh
diff --git a/contrib/centos/gobgpd.service b/tools/contrib/centos/gobgpd.service
index 5aac6d7b..5aac6d7b 100644
--- a/contrib/centos/gobgpd.service
+++ b/tools/contrib/centos/gobgpd.service
diff --git a/contrib/ubuntu/gobgpd.conf b/tools/contrib/ubuntu/gobgpd.conf
index ba1ef826..ba1ef826 100644
--- a/contrib/ubuntu/gobgpd.conf
+++ b/tools/contrib/ubuntu/gobgpd.conf
diff --git a/tools/route-server/quagga-rsconfig.go b/tools/route-server/quagga-rsconfig.go
index 517125f3..24ff62c3 100644
--- a/tools/route-server/quagga-rsconfig.go
+++ b/tools/route-server/quagga-rsconfig.go
@@ -11,7 +11,7 @@ import (
"github.com/BurntSushi/toml"
"github.com/jessevdk/go-flags"
- "github.com/osrg/gobgp/config"
+ "github.com/osrg/gobgp/internal/pkg/config"
)
type QuaggaConfig struct {