-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Golang Http Tcp Bridge #36667
Open
duxin40
wants to merge
73
commits into
envoyproxy:main
Choose a base branch
from
duxin40:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 70 commits
Commits
Show all changes
73 commits
Select commit
Hold shift + click to select a range
01813c1
support golang tcp extension for http2tcp
ed300bb
Merge pull request #8 from duxin40/main-merge
duxin40 1386488
merge code of opensource main
6946c93
rollback go package version to follow opensource code
7ae6768
fix error for tests
a60f4fa
fix error for tests
e8234db
add example for http2dubbo by golang extension on envoy
17bc4a4
delete unused code
4b5880c
add new blank line
4abfe0a
Optimize http2dubbo example
da41130
format example code
1c35411
format example code
98e1589
support EncodeHeaders for goalng tcp upstream extension
9bb967c
1.support set buffer for writing upstream data 2.support specify cust…
0b7fde5
1. add example for http2dubbo by golang-tcp-upstream-extension. 2. op…
5898f45
optimize http2dubbo example
7c21160
optimize annotation for http2dubbo example
de5d85d
delete ununsed file
1d2d0ac
optimize annotation for http2dubbo example
152118b
support unique ptr for tcp_upstream and tcp_conn_pool
08bb49e
optimize code
c92c078
1.add destructor func for tcp upstream and filter. 2.optimize code
0cc11de
optimize logic for upstream config
8187006
optimize and delete unuse code
c056752
1. remove weak_filter of async, and use sync clearly bteween go and c++.
28b8111
delete unused code
2d1abdd
simplify & optimize status and state
185818c
support full-duplex
9dd2d0c
add notes for status and fix bug
65e4796
add docks for golang tcp upstream filter
1260dd7
optimize envoyGoTcpUpstreamDestroyPluginConfig and envoyGoOnTcpUpstre…
bc83d9b
delete state.doDataList in encodeHeaders and encodeData
8cf3668
optimize annotation
be318e2
delete unused go code
75a9c41
delete unused code
d3a44cf
optimize code
58d24c3
update doc and example
24480de
delete processState
663afc8
Revert "delete processState"
a8fa562
optimize code
2c47930
Merge branch 'main' into main
duxin40 6872fc5
optimize code
e7eb50b
delete unused log
143875b
optimize about mutex and panic
0714aa7
simplfy logic about panic
6541f8d
optimize code
79401ba
optimize code
613a192
fix memory leaking
6d54120
optimize annoation
fd60445
format code
b32eabe
format code
7eaef90
fix ci problem
ac75587
remove lock since the plugin is sync-data-flow between c and go
4595abd
optimize code about panic
ad43324
terminate the stream when get panic
e314824
add integration test for golang-http-tcp-bridge
0dc67d0
fix ci problem
3869b18
optimize doc
1fbe401
format code
248045f
optimize annotation and merge multiple test go mods into a single one
c8942ba
add go.mod for test_data
e12539d
add a test for add_data
a4ef3f6
format code
914297e
Merge branch 'main' into main
duxin40 8adb4d8
format code and doc
eb33333
optimize doc
8baaee6
update doc and ci
74e0dc3
touch ci
1b09fd5
update doc
adae974
format doc
048e44f
optimize doc
b918a08
Merge branch 'main' into main
duxin40 2eec96e
optimize doc
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
12 changes: 12 additions & 0 deletions
12
api/contrib/envoy/extensions/upstreams/http/tcp/golang/v3alpha/BUILD
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,12 @@ | ||
# DO NOT EDIT. This file is generated by tools/proto_format/proto_sync.py. | ||
|
||
load("@envoy_api//bazel:api_build_system.bzl", "api_proto_package") | ||
|
||
licenses(["notice"]) # Apache 2 | ||
|
||
api_proto_package( | ||
deps = [ | ||
"@com_github_cncf_xds//udpa/annotations:pkg", | ||
"@com_github_cncf_xds//xds/annotations/v3:pkg", | ||
], | ||
) |
50 changes: 50 additions & 0 deletions
50
api/contrib/envoy/extensions/upstreams/http/tcp/golang/v3alpha/golang.proto
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,50 @@ | ||
syntax = "proto3"; | ||
|
||
package envoy.extensions.upstreams.http.tcp.golang.v3alpha; | ||
|
||
import "google/protobuf/any.proto"; | ||
|
||
import "xds/annotations/v3/status.proto"; | ||
|
||
import "udpa/annotations/status.proto"; | ||
import "validate/validate.proto"; | ||
|
||
option java_package = "io.envoyproxy.envoy.extensions.upstreams.http.tcp.golang.v3alpha"; | ||
option java_outer_classname = "GolangProto"; | ||
option java_multiple_files = true; | ||
option go_package = "github.com/envoyproxy/go-control-plane/contrib/envoy/extensions/upstreams/http/tcp/golang/v3alpha"; | ||
option (udpa.annotations.file_status).package_version_status = ACTIVE; | ||
option (xds.annotations.v3.file_status).work_in_progress = true; | ||
|
||
// [#protodoc-title: Golang HTTP TCP Bridge] | ||
// | ||
// This bridge enables an Http client to connect to a TCP server via a Golang plugin, facilitating Protocol Convert from HTTP to any RPC protocol in Envoy. | ||
// | ||
// For an overview of the Golang HTTP TCP bridge please see the :ref:`configuration reference documentation <config_http_tcp_bridge_golang>`. | ||
// [#extension: envoy.upstreams.http.tcp.golang] | ||
message Config { | ||
// Globally unique ID for a dynamic library file. | ||
string library_id = 1 [(validate.rules).string = {min_len: 1}]; | ||
|
||
// Path to a dynamic library implementing the | ||
// :repo:`HttpTcpBridge API <contrib/golang/common/go/api.HttpTcpBridge>` | ||
// interface. | ||
string library_path = 2 [(validate.rules).string = {min_len: 1}]; | ||
|
||
// Globally unique name of the Go plugin. | ||
// | ||
// This name **must** be consistent with the name registered in ``tcp::RegisterHttpTcpBridgeFactoryAndConfigParser`` | ||
// | ||
string plugin_name = 3 [(validate.rules).string = {min_len: 1}]; | ||
duxin40 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
// Configuration for the Go plugin. | ||
// | ||
// .. note:: | ||
// This configuration is only parsed in the Golang plugin, and is therefore not validated | ||
// by Envoy. | ||
// | ||
// See the :repo:`HttpTcpBridge API <contrib/golang/common/go/api/filter.go>` | ||
// for more information about how the plugin's configuration data can be accessed. | ||
// | ||
google.protobuf.Any plugin_config = 4; | ||
} |
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
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please follow this #37962, merge gomods into a single one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it this still required? afaict this uses the same deps that have been merged, surely we can use an existing go.mod?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your review~ At present, I have merged multiple go.mo into one go.mod, but I understand that this PR should at least add a go mod configuration to the file, because the go mod directory(/contrib/golang/upstreams/http/tcp/test/test_data) involved in this PR and the existing directory is different. I don’t know if I understand it correctly. I hope you can correct me if I am wrong. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure - @doujiang24 can this be avoided?