-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ccl/sqlproxyccl: add pkg/ccl/sqlproxyccl/tenant/{servicedir,simpledir}
Previously, all directory related files are located in a tenant package, which can be confusing. This commit moves files into specific directories, and is purely mechanical. Release note: None
- Loading branch information
1 parent
56a3c0b
commit 695f8e1
Showing
19 changed files
with
209 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,82 +1,10 @@ | ||
load("@bazel_gomock//:gomock.bzl", "gomock") | ||
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") | ||
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") | ||
load("@rules_proto//proto:defs.bzl", "proto_library") | ||
|
||
proto_library( | ||
name = "tenant_proto", | ||
srcs = ["directory.proto"], | ||
strip_import_prefix = "/pkg", | ||
visibility = ["//visibility:public"], | ||
deps = ["@com_github_gogo_protobuf//gogoproto:gogo_proto"], | ||
) | ||
|
||
go_proto_library( | ||
name = "tenant_go_proto", | ||
compilers = ["//pkg/cmd/protoc-gen-gogoroach:protoc-gen-gogoroach_grpc_compiler"], | ||
importpath = "github.com/cockroachdb/cockroach/pkg/ccl/sqlproxyccl/tenant", | ||
proto = ":tenant_proto", | ||
visibility = ["//visibility:public"], | ||
deps = ["@com_github_gogo_protobuf//gogoproto"], | ||
) | ||
load("@io_bazel_rules_go//go:def.bzl", "go_library") | ||
|
||
go_library( | ||
name = "tenant", | ||
srcs = [ | ||
"entry.go", | ||
"pod.go", | ||
"resolver.go", | ||
"service_directory.go", | ||
"simple_directory.go", | ||
], | ||
embed = [":tenant_go_proto"], | ||
srcs = ["resolver.go"], | ||
importpath = "github.com/cockroachdb/cockroach/pkg/ccl/sqlproxyccl/tenant", | ||
visibility = ["//visibility:public"], | ||
deps = [ | ||
"//pkg/roachpb", | ||
"//pkg/util/grpcutil", | ||
"//pkg/util/log", | ||
"//pkg/util/randutil", | ||
"//pkg/util/stop", | ||
"//pkg/util/syncutil", | ||
"//pkg/util/timeutil", | ||
"@org_golang_google_grpc//codes", | ||
"@org_golang_google_grpc//status", | ||
], | ||
) | ||
|
||
go_test( | ||
name = "tenant_test", | ||
size = "large", | ||
srcs = [ | ||
"main_test.go", | ||
"pod_test.go", | ||
"service_directory_test.go", | ||
"simple_directory_test.go", | ||
], | ||
embed = [":tenant"], | ||
deps = [ | ||
"//pkg/base", | ||
"//pkg/ccl", | ||
"//pkg/ccl/kvccl/kvtenantccl", | ||
"//pkg/ccl/sqlproxyccl/tenantdirsvr", | ||
"//pkg/ccl/utilccl", | ||
"//pkg/roachpb", | ||
"//pkg/security", | ||
"//pkg/security/securitytest", | ||
"//pkg/server", | ||
"//pkg/sql", | ||
"//pkg/testutils", | ||
"//pkg/testutils/serverutils", | ||
"//pkg/testutils/skip", | ||
"//pkg/testutils/testcluster", | ||
"//pkg/util/leaktest", | ||
"//pkg/util/log", | ||
"//pkg/util/randutil", | ||
"//pkg/util/stop", | ||
"@com_github_stretchr_testify//require", | ||
"@org_golang_google_grpc//:go_default_library", | ||
"@org_golang_google_grpc//codes", | ||
"@org_golang_google_grpc//status", | ||
], | ||
deps = ["//pkg/roachpb"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
load("@rules_proto//proto:defs.bzl", "proto_library") | ||
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") | ||
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") | ||
|
||
proto_library( | ||
name = "servicedir_proto", | ||
srcs = ["directory.proto"], | ||
strip_import_prefix = "/pkg", | ||
visibility = ["//visibility:public"], | ||
deps = ["@com_github_gogo_protobuf//gogoproto:gogo_proto"], | ||
) | ||
|
||
go_proto_library( | ||
name = "servicedir_go_proto", | ||
compilers = ["//pkg/cmd/protoc-gen-gogoroach:protoc-gen-gogoroach_grpc_compiler"], | ||
importpath = "github.com/cockroachdb/cockroach/pkg/ccl/sqlproxyccl/tenant/servicedir", | ||
proto = ":servicedir_proto", | ||
visibility = ["//visibility:public"], | ||
deps = ["@com_github_gogo_protobuf//gogoproto"], | ||
) | ||
|
||
go_library( | ||
name = "servicedir", | ||
srcs = [ | ||
"entry.go", | ||
"pod.go", | ||
"service_directory.go", | ||
], | ||
embed = [":servicedir_go_proto"], | ||
importpath = "github.com/cockroachdb/cockroach/pkg/ccl/sqlproxyccl/tenant/servicedir", | ||
visibility = ["//visibility:public"], | ||
deps = [ | ||
"//pkg/ccl/sqlproxyccl/tenant", | ||
"//pkg/roachpb", | ||
"//pkg/util/grpcutil", | ||
"//pkg/util/log", | ||
"//pkg/util/randutil", | ||
"//pkg/util/stop", | ||
"//pkg/util/syncutil", | ||
"//pkg/util/timeutil", | ||
"@org_golang_google_grpc//codes", | ||
"@org_golang_google_grpc//status", | ||
], | ||
) | ||
|
||
go_test( | ||
name = "servicedir_test", | ||
srcs = [ | ||
"main_test.go", | ||
"pod_test.go", | ||
"service_directory_test.go", | ||
], | ||
embed = [":servicedir"], | ||
deps = [ | ||
"//pkg/base", | ||
"//pkg/ccl", | ||
"//pkg/ccl/kvccl/kvtenantccl", | ||
"//pkg/ccl/sqlproxyccl/tenant", | ||
"//pkg/ccl/sqlproxyccl/tenantdirsvr", | ||
"//pkg/ccl/utilccl", | ||
"//pkg/roachpb", | ||
"//pkg/security", | ||
"//pkg/security/securitytest", | ||
"//pkg/server", | ||
"//pkg/sql", | ||
"//pkg/testutils/serverutils", | ||
"//pkg/testutils/skip", | ||
"//pkg/testutils/testcluster", | ||
"//pkg/util/leaktest", | ||
"//pkg/util/log", | ||
"//pkg/util/randutil", | ||
"//pkg/util/stop", | ||
"@com_github_stretchr_testify//require", | ||
"@org_golang_google_grpc//:go_default_library", | ||
"@org_golang_google_grpc//codes", | ||
"@org_golang_google_grpc//status", | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
pkg/ccl/sqlproxyccl/tenant/entry.go → ...cl/sqlproxyccl/tenant/servicedir/entry.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
pkg/ccl/sqlproxyccl/tenant/pod.go → pkg/ccl/sqlproxyccl/tenant/servicedir/pod.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
pkg/ccl/sqlproxyccl/tenant/pod_test.go → ...sqlproxyccl/tenant/servicedir/pod_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.