forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 0
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 postgres interceptors for message forwarding
Informs cockroachdb#76000. This commit implements postgres interceptors, namely FrontendInterceptor and BackendInterceptor, as described in the sqlproxy connection migration RFC. These interceptors will be used as building blocks for the forwarder component that we will be adding in a later PR. Since the forwarder component has not been added, a simple proxy test (i.e. TestSimpleProxy) has been added to illustrate how the frontend and backend interceptors can be used within the proxy. Release note: None
- Loading branch information
1 parent
18e4193
commit a983a19
Showing
4 changed files
with
1,324 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") | ||
|
||
go_library( | ||
name = "interceptor", | ||
srcs = ["interceptor.go"], | ||
importpath = "github.com/cockroachdb/cockroach/pkg/ccl/sqlproxyccl/interceptor", | ||
visibility = ["//visibility:public"], | ||
deps = [ | ||
"//pkg/sql/pgwire/pgwirebase", | ||
"@com_github_cockroachdb_errors//:errors", | ||
"@com_github_jackc_pgproto3_v2//:pgproto3", | ||
], | ||
) | ||
|
||
go_test( | ||
name = "interceptor_test", | ||
srcs = ["interceptor_test.go"], | ||
embed = [":interceptor"], | ||
deps = [ | ||
"//pkg/sql/pgwire/pgwirebase", | ||
"//pkg/util/leaktest", | ||
"@com_github_cockroachdb_errors//:errors", | ||
"@com_github_jackc_pgproto3_v2//:pgproto3", | ||
"@com_github_stretchr_testify//require", | ||
], | ||
) |
Oops, something went wrong.