-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Envoy's L7 Go extension API #22573
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
Merged
mattklein123
merged 119 commits into
envoyproxy:main
from
wangfakang:golang-extension-api
Jan 5, 2023
Merged
Envoy's L7 Go extension API #22573
Changes from 58 commits
Commits
Show all changes
119 commits
Select commit
Hold shift + click to select a range
7a45ea5
Merge pull request #1 from envoyproxy/master
wangfakang 1335354
Merge pull request #2 from envoyproxy/master
wangfakang 446c4b1
Merge pull request #3 from envoyproxy/master
wangfakang 8e7d66a
Merge pull request #4 from envoyproxy/master
wangfakang 7d72ab9
Merge pull request #5 from envoyproxy/master
wangfakang dd0dba9
Merge pull request #6 from envoyproxy/master
wangfakang 091fd77
Merge pull request #7 from envoyproxy/main
wangfakang d9dcf64
Merge pull request #8 from envoyproxy/main
wangfakang 95c509b
Merge pull request #9 from envoyproxy/main
wangfakang 1c5859a
Merge pull request #20 from envoyproxy/main
wangfakang e272f6a
Merge pull request #59 from envoyproxy/main
wangfakang 0f77a38
Merge pull request #71 from envoyproxy/main
wangfakang d05e4cf
Merge pull request #72 from envoyproxy/main
wangfakang 023d3a9
Merge pull request #74 from envoyproxy/main
wangfakang d091174
Merge pull request #83 from envoyproxy/main
wangfakang 4c88aad
Merge pull request #93 from envoyproxy/main
wangfakang 1d788fe
Merge pull request #97 from envoyproxy/main
wangfakang 4c68eb0
Merge branch 'envoyproxy:main' into master
wangfakang 4dc847b
Merge pull request #108 from envoyproxy/main
wangfakang 1a620b6
Merge pull request #117 from envoyproxy/main
wangfakang 4bd041e
Merge branch 'envoyproxy:main' into master
wangfakang 5318196
Merge pull request #133 from envoyproxy/main
wangfakang 88d279f
Merge pull request #154 from envoyproxy/main
wangfakang 0c677c3
Merge pull request #166 from envoyproxy/main
wangfakang 23a9ba3
Merge pull request #169 from envoyproxy/main
wangfakang ce02fd8
Merge pull request #170 from envoyproxy/main
wangfakang 755b023
Merge pull request #194 from envoyproxy/main
wangfakang df47643
Merge pull request #216 from envoyproxy/main
wangfakang 0886f78
Merge pull request #229 from envoyproxy/main
wangfakang 6bb0267
Merge pull request #237 from envoyproxy/main
wangfakang 68ee9d3
Merge pull request #240 from envoyproxy/main
wangfakang b99b024
Merge branch 'envoyproxy:main' into master
wangfakang 2569f89
Merge pull request #256 from envoyproxy/main
wangfakang 743011e
Merge branch 'envoyproxy:main' into master
wangfakang ab72745
Merge pull request #277 from envoyproxy/main
wangfakang 84955d8
Merge pull request #289 from envoyproxy/main
wangfakang 74e0878
Merge pull request #296 from envoyproxy/main
wangfakang 0859ead
Merge pull request #371 from envoyproxy/main
wangfakang f995b29
Merge pull request #395 from envoyproxy/main
wangfakang d4ab8e7
Merge branch 'envoyproxy:main' into master
wangfakang 2f4343f
Merge branch 'envoyproxy:main' into master
wangfakang edd4cfe
Merge branch 'envoyproxy:main' into master
wangfakang 02f2d17
add dso api for specialized functionality into Envoy dynamically at r…
wangfakang 121aec7
add go extension filter config api.
wangfakang c003e89
add go plugin api.
wangfakang 097a360
moved go plugin api to contrib dirctory.
wangfakang 9499dbb
fix format typo.
wangfakang d24f1d0
Merge branch 'main' into golang-extension-api
wangfakang ba8b068
add some doc for dso api.
wangfakang 2918b79
Merge the DSO functionality into the Go filter.
wangfakang 8107dbd
add samples go filter ref.
wangfakang be380d3
modify api version from v3 to v3alpha.
wangfakang eeda2e9
Adds a golang filter example.
wangfakang 8490425
fix Permission issue.
wangfakang 0c00e27
remove some useless files.
wangfakang 6c3c20f
Use vendor mode to compile the examples and avoid pulling external co…
wangfakang 95a40db
fix modernize-use-using issue.
wangfakang 57ffc1c
remove vendor and make it completely self contained.
wangfakang 137f150
add golang filter.
wangfakang 74fe365
Merge branch 'envoyproxy:main' into master
wangfakang 5c4f719
add go extension filter implementation.
wangfakang 6533a5a
update go extension examples.
wangfakang 8b33b9e
update some comment for go extension proto.
wangfakang 82f9753
remove useless files.
wangfakang deea158
fix envoy yaml for golang example.
wangfakang 6aea9da
update bazel files for build golang extension.
wangfakang 9b10755
add docs for golang extension filter.
wangfakang 95ebef5
Merge branch 'envoyproxy:main' into master
wangfakang 8cee369
fix build typo.
wangfakang 1b8bd75
fix style.
wangfakang a250351
fix code typo.
wangfakang 2fac8bb
delete golang sandboxes temporarily, later it will be submitted in an…
wangfakang 96ab6c4
fix doc typo.
wangfakang 621b9bd
fix typo by bazel.clang_tidy.
wangfakang 17fd6c2
fix typo.
wangfakang 181d00e
clear route cache when headers changed.
wangfakang 2236944
Merge branch 'envoyproxy:main' into master
wangfakang 48920e4
Merge branch 'envoyproxy:main' into master
wangfakang 9312170
update some files for clean.
wangfakang f44ca44
add integration tests for golang filter.
wangfakang a2f78ef
add integration tests for passthrough go filter.
wangfakang b36a902
add example for extension_plugin_options.
wangfakang 1d0c509
add some comments and avoid use raw memeroy etc, thanks @mattklein123.
wangfakang b29b4a8
Merge branch 'envoyproxy:main' into master
wangfakang 1b03764
Merge remote-tracking branch 'origin/master' into golang-extension-ap…
wangfakang a126daa
fix Filter1XXHeaderStatus for golang extension.
wangfakang 31e210b
fix example path of echo.
wangfakang cfd5ce3
make go extension api fully typed, thanks @mattklein123.
wangfakang 8bd8b93
Merge branch 'envoyproxy:main' into master
wangfakang 29a8b5c
remove unused struct.proto for golang.proto.
wangfakang 66258bb
Merge remote-tracking branch 'origin/master' into golang-extension-ap…
wangfakang 7cc9391
Update contrib/golang/filters/http/source/common/dso/dso.h
wangfakang 41186b7
Update contrib/golang/filters/http/source/common/dso/dso.h
wangfakang 2ea7100
improve the code via ABSL_EXCLUSIVE_LOCKS and MUTABLE_CONSTRUCT_ON_FI…
wangfakang c063d61
fix typo and resolve some todo.
wangfakang a186eba
use NonCopyable instead of delete operation.
wangfakang ea51e0b
use struct to encapsulate dso and add ABSL_EXCLUSIVE_LOCKS_REQUIRED. …
wangfakang e0ecfc9
fix typo.
wangfakang 1592489
Merge branch 'envoyproxy:main' into master
wangfakang 1ca4641
Merge remote-tracking branch 'origin/master' into golang-extension-ap…
wangfakang 5567bd5
add ABSL_GUARDED_BY for the members.thanks @mattklein123
wangfakang cef804a
cleanup useless code and add some comments for memcpy safe. thanks @m…
wangfakang e6b8ff4
Merge branch 'envoyproxy:main' into master
wangfakang 9718071
Merge remote-tracking branch 'origin/master' into golang-extension-ap…
wangfakang d6c8ddb
Merge branch 'envoyproxy:main' into master
wangfakang babd11f
Merge branch 'envoyproxy:main' into master
wangfakang 5cd3277
Merge remote-tracking branch 'origin/master' into golang-extension-ap…
wangfakang 659e4a0
Update contrib/golang/filters/http/source/golang_filter.cc
wangfakang 0060264
make code clear and update log level. thanks @mattklein123
wangfakang 13766aa
update current.yaml for golang extension.
wangfakang b444671
Merge branch 'envoyproxy:main' into master
wangfakang 95e9a1a
Merge remote-tracking branch 'origin/master' into golang-extension-ap…
wangfakang eb4d845
Merge branch 'envoyproxy:main' into master
wangfakang d047583
make code clear and update log level to debug. thanks @mattklein123
wangfakang 91243de
Merge remote-tracking branch 'origin/master' into golang-extension-ap…
wangfakang cb4c14b
Merge branch 'envoyproxy:main' into master
wangfakang 7b8a618
use assert to make the code clearer. thanks @mattklein123
wangfakang 1a12ad8
Merge remote-tracking branch 'origin/master' into golang-extension-ap…
wangfakang 6dbdb3a
remove all unused code. thanks @mattklein123
wangfakang 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 hidden or 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/filters/http/golang/v3alpha/BUILD
This file contains hidden or 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_udpa//udpa/annotations:pkg", | ||
| "@com_github_cncf_udpa//xds/annotations/v3:pkg", | ||
| ], | ||
| ) |
195 changes: 195 additions & 0 deletions
195
api/contrib/envoy/extensions/filters/http/golang/v3alpha/golang.proto
This file contains hidden or 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,195 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| package envoy.extensions.filters.http.golang.v3alpha; | ||
|
|
||
| import "google/protobuf/any.proto"; | ||
| import "google/protobuf/struct.proto"; | ||
|
|
||
| import "xds/annotations/v3/status.proto"; | ||
|
|
||
| import "udpa/annotations/status.proto"; | ||
| import "validate/validate.proto"; | ||
|
|
||
| option java_package = "io.envoyproxy.envoy.extensions.filters.http.golang.v3alpha"; | ||
| option java_outer_classname = "GolangProto"; | ||
| option java_multiple_files = true; | ||
| option go_package = "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/golang/v3alpha"; | ||
| option (udpa.annotations.file_status).package_version_status = ACTIVE; | ||
| option (xds.annotations.v3.file_status).work_in_progress = true; | ||
|
|
||
| // [#protodoc-title: golang extension filter] | ||
| // golang extension filter. | ||
| // | ||
| // In the below example, we configured the go plugin 'auth' and 'limit' dynamic libraries into | ||
| // Envoy, which can avoid rebuilding Envoy. | ||
| // | ||
| // * Develop go-plugin | ||
| // | ||
| // We can implement the interface of :ref:`StreamFilter <contrib.go_plugin_api.plugin.StreamFilter>` | ||
| // API by the GO language to achieve the effects of Envoy native filter. | ||
| // | ||
| // The filter based on the APIs implementation :ref:`StreamFilter <contrib.go_plugin_api.plugin.StreamFilter>` | ||
| // For details, take a look at the :ref:`golang plugin filter sandbox example <install_sandboxes_golang>`. | ||
| // | ||
| // Then put the GO plugin source code into the ${OUTPUT}/src/ directory with the name of the plugin | ||
| // for GO plugin builds. | ||
| // The following examples implement limit and auth GO plugins. | ||
| // | ||
| // .. code-block:: bash | ||
| // | ||
| // $tree /home/admin/envoy/go-plugins/src/ | ||
| // |--auth | ||
| // | |--config.go | ||
| // | |--filter.go | ||
| // ---limit | ||
| // |--config.go | ||
| // |--filter.go | ||
| // | ||
| // * Build go-plugin | ||
| // | ||
| // Build the Go plugin so by `go_plugin_generate.sh` script, below example the `liblimit.so` and | ||
| // `libauth.so` will be generated in the `/home/admin/envoy/go-plugins/` directory. | ||
| // | ||
| // .. code-block:: bash | ||
| // | ||
| // #!/bin/bash | ||
| // if [ $# != 2 ]; then | ||
| // echo "need input the go plugin name" | ||
| // exit 1 | ||
| // fi | ||
| // | ||
| // PLUGINNAME=$1 | ||
| // OUTPUT=/home/admin/envoy/go-plugins/ | ||
| // PLUGINSRCDIR=${OUTPUT}/src/${PLUGINNAME} | ||
| // go build --buildmode=c-shared -v -o $OUTPUT/lib${PLUGINNAME}.so $PLUGINSRCDIR | ||
| // | ||
| // .. code-block:: bash | ||
| // | ||
| // $go_plugin_generate.sh limit | ||
| // $go_plugin_generate.sh auth | ||
| // | ||
| // * Configure go-plugin | ||
| // | ||
| // Use the http filter of :ref: `golang <envoy.filters.http.golang>` to specify | ||
| // :ref: `library` <envoy.filters.http.golang> in ingress and egress to enable the plugin. | ||
| // | ||
| // Example: | ||
| // | ||
| // .. code-block:: yaml | ||
| // | ||
| // static_resources: | ||
| // listeners: | ||
| // - name: ingress | ||
| // address: | ||
| // socket_address: | ||
| // protocol: TCP | ||
| // address: 0.0.0.0 | ||
| // port_value: 8080 | ||
| // filter_chains: | ||
| // - filters: | ||
| // - name: envoy.filters.network.http_connection_manager | ||
| // ...... | ||
| // http_filters: | ||
| // - name: envoy.filters.http.golang | ||
| // typed_config: | ||
| // "@type": type.googleapis.com/envoy.extensions.filters.http.golang.v3alpha.Config | ||
| // library: "/home/admin/envoy/go-plugins/liblimit.so" | ||
| // plugine_name: limit | ||
| // plugin_config: | ||
| // "@type": type.googleapis.com/envoy.extensions.filters.http.golang.plugins.limit.v3.Config | ||
| // xxx1: xx1 | ||
| // xxx2: xx2 | ||
| // - name: envoy.filters.http.header_to_metadata | ||
| // - name: envoy.filters.http.golang | ||
| // typed_config: | ||
| // "@type": type.googleapis.com/envoy.extensions.filters.http.golang.v3alpha.Config | ||
| // library: "/home/admin/envoy/go-plugins/libauth.so" | ||
| // plugine_name: auth | ||
| // plugin_config: | ||
| // "@type": type.googleapis.com/envoy.extensions.filters.http.golang.plugins.auth.v3.Config | ||
| // xxx1: xx1 | ||
| // xxx2: xx2 | ||
| // - name: envoy.filters.http.router | ||
| // - name: egress | ||
| // address: | ||
| // socket_address: | ||
| // protocol: TCP | ||
| // address: 0.0.0.0 | ||
| // port_value: 8081 | ||
| // filter_chains: | ||
| // - filters: | ||
| // - name: envoy.filters.network.http_connection_manager | ||
| // ...... | ||
| // http_filters: | ||
| // - name: envoy.filters.http.golang | ||
| // typed_config: | ||
| // "@type": type.googleapis.com/envoy.extensions.filters.http.golang.v3alpha.Config | ||
| // library: "/home/admin/envoy/go-plugins/libauth.so" | ||
| // plugine_name: auth | ||
| // plugin_config: | ||
| // "@type": type.googleapis.com/envoy.extensions.filters.http.golang.plugins.auth.v3.Config | ||
| // xxx1: xx1 | ||
| // xxx2: xx2 | ||
| // - name: envoy.filters.http.router | ||
| // [#not-implemented-hide:] | ||
| message Config { | ||
| enum MergePolicy { | ||
| MERGE_VIRTUALHOST_ROUTER_FILTER = 0; | ||
| MERGE_VIRTUALHOST_ROUTER = 1; | ||
| OVERRIDE = 3; | ||
| } | ||
|
|
||
| // Dynamic library implementing the interface of | ||
| // :ref:`StreamFilter <contrib.go_plugin_api.plugin.StreamFilter>`. | ||
| // [#comment:TODO(wangfakang): Support for downloading libraries from remote repositories.] | ||
| string library = 1 [(validate.rules).string = {min_len: 1}]; | ||
|
|
||
| // plugin_name is the name of the go plugin, which needs to be consistent with the name | ||
| // registered in StreamFilterFactoryManager::RegisterStreamFactory. | ||
| string plugin_name = 2 [(validate.rules).string = {min_bytes: 1}]; | ||
|
|
||
| // plugin_config is the configuration of the go plugin, note that this configuration is | ||
| // only parsed in the go plugin. | ||
| google.protobuf.Any plugin_config = 3; | ||
|
|
||
| // merge_policy is the merge policy configured by the go plugin. | ||
| // go plugin configuration supports three dimensions: the virtual host’s typed_per_filter_config, | ||
| // the route’s typed_per_filter_config or filter's config. | ||
| // The meanings are as follows: | ||
| // MERGE_VIRTUALHOST_ROUTER_FILTER: pass all configuration into go plugin. | ||
| // MERGE_VIRTUALHOST_ROUTER: pass Virtual-Host and Router configuration into go plugin. | ||
| // OVERRIDE: override according to Router > Virtual_host > Filter priority and pass the | ||
| // configuration to the go plugin. | ||
| MergePolicy merge_policy = 4 [(validate.rules).enum = {defined_only: true}]; | ||
| } | ||
|
|
||
| // [#not-implemented-hide:] | ||
| message RouterPlugin { | ||
| // The extension_plugin_options field is used to provide extension options for plugin. | ||
| google.protobuf.Struct extension_plugin_options = 1; | ||
|
|
||
| // The config field is used to setting plugin config. | ||
| google.protobuf.Any config = 2; | ||
| } | ||
|
|
||
| // [#not-implemented-hide:] | ||
| message ConfigsPerRoute { | ||
| // plugins_config is the configuration of the go plugin at the per-router, and | ||
| // key is the name of the go plugin. | ||
| // Example | ||
| // typed_per_filter_config: | ||
| // golang: | ||
| // "@type": type.googleapis.com/golang.http.ConfigsPerRoute | ||
| // plugins_config: | ||
| // plugin1: | ||
| // extension_plugin_options: | ||
| // disabled: true | ||
| // config: | ||
| // "@type": type.googleapis.com/golang.http.plugin1 | ||
| // xxx: xxx | ||
| // plugin2: | ||
| // config: | ||
| // "@type": type.googleapis.com/golang.http.plugin2 | ||
| // xxx: xxx | ||
| map<string, RouterPlugin> plugins_config = 1; | ||
| } | ||
This file contains hidden or 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 hidden or 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,70 @@ | ||
| package plugin | ||
|
wangfakang marked this conversation as resolved.
Outdated
|
||
|
|
||
| // Stream Filter | ||
| // refer https://github.com/envoyproxy/envoy/blob/main/envoy/http/filter.h | ||
| type StreamFilter interface { | ||
| // request stream | ||
| StreamDecoderFilter | ||
| // response stream | ||
| StreamEncoderFilter | ||
| // stream complete | ||
| OnStreamComplete() | ||
| // error log | ||
| Log(LogType, string) | ||
| // destroy filter | ||
| OnDestroy() | ||
| } | ||
|
|
||
| // request | ||
| type StreamDecoderFilter interface { | ||
| DecodeHeaders(RequestHeaderMap, bool) StatusType | ||
| DecodeData(BufferInstance, bool) StatusType | ||
| DecodeTrailers(RequestTrailerMap) StatusType | ||
| DecodeMetadata(MetadataMap) StatusType | ||
| DecoderCallbacks() DecoderFilterCallbacks | ||
| } | ||
|
|
||
| // response | ||
| type StreamEncoderFilter interface { | ||
| EncodeHeaders(ResponseHeaderMap, bool) StatusType | ||
| EncodeData(BufferInstance, bool) StatusType | ||
| EncodeTrailers(ResponseTrailerMap) StatusType | ||
| EncodeMetadata(MetadataMap) StatusType | ||
| EncoderCallbacks() EncoderFilterCallbacks | ||
| } | ||
|
|
||
| // stream info | ||
| // refer https://github.com/envoyproxy/envoy/blob/main/envoy/stream_info/stream_info.h | ||
| type StreamInfo interface { | ||
| GetRouteName() string | ||
| VirtualClusterName() string | ||
| BytesReceived() int64 | ||
| BytesSent() int64 | ||
| Protocol() string | ||
| ResponseCode() int | ||
| GetRequestHeaders() RequestHeaderMap | ||
| ResponseCodeDetails() string | ||
| } | ||
|
|
||
| type StreamFilterCallbacks interface { | ||
| StreamInfo() StreamInfo | ||
| } | ||
|
|
||
| type DecoderFilterCallbacks interface { | ||
| StreamFilterCallbacks | ||
| ContinueDecoding() | ||
| AddDecodedData(buffer BufferInstance, streamingFilter bool) | ||
| SendLocalReply(response_code int, body_text string, headers map[string]string, details string) | ||
| } | ||
|
|
||
| type EncoderFilterCallbacks interface { | ||
| StreamFilterCallbacks | ||
| ContinueEncoding() | ||
| AddEncodedData(buffer BufferInstance, streamingFilter bool) | ||
| SendLocalReply(response_code int, body_text string, headers map[string]string, details string) | ||
| } | ||
|
|
||
| type FilterCallbackHandler interface { | ||
| DecoderFilterCallbacks | ||
| EncoderFilterCallbacks | ||
| } | ||
This file contains hidden or 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,55 @@ | ||
| package plugin | ||
|
|
||
| //****************** filter factory start ******************// | ||
| // StreamFilterFactory is used to inherit from callbacks | ||
| // and generate a specific filter. | ||
| type StreamFilterFactory func(callbacks FilterCallbackHandler) StreamFilter | ||
|
|
||
| // StreamFilterConfigFactory stream filter config factory interface | ||
| type StreamFilterConfigFactory interface { | ||
| // CreateFilterConfigFactory is create filter factory and it usually | ||
| // occurs during the filter config parse phase. | ||
| // config[] is google.protobuf.Any type and go plugin filter | ||
| // can parse the detailed configuration according to its own pb. | ||
| CreateFilterConfigFactory(config [][]byte) (StreamFilterFactory, error) | ||
| } | ||
|
|
||
| // StreamFilterConfigFactoryManager is manager stream filter config factory. | ||
| type StreamFilterConfigFactoryManager interface { | ||
| // RegisterFilterConfigFactory register a config factory via filter name. | ||
| RegisterFilterConfigFactory(name string, factory StreamFilterConfigFactory) StreamFilterConfigFactory | ||
| // GetConfigFactory get a stream factory by filter name. | ||
| GetFilterConfigFactory(name string) StreamFilterConfigFactory | ||
| } | ||
|
|
||
| // StreamFilterFactoryManager is manager stream filter factory. | ||
| type StreamFilterFactoryManager interface { | ||
| // StoreFilterFactory is store a stream filter factor by uuid | ||
| // and each stream's filter mapped by a uuid at parse filter config phase. | ||
| // The uuid is created during filter config parse phase. | ||
| StoreFilterFactory(uuid uint64, ins StreamFilterFactory) | ||
| // GetFilterFactory get a stream filter factor by uuid. | ||
| GetFilterFactory(uuid uint64) StreamFilterFactory | ||
| // DeleteFilterFactory remove a stream filter factor by uuid | ||
| // and it usually occurs during the configuration update phase. | ||
| DeleteFilterFactory(uuid uint64) | ||
| } | ||
|
|
||
| //****************** filter factory end ******************// | ||
|
|
||
| //***************** filter manager start *****************// | ||
| // StreamFilterManager is manager stream filter. | ||
| type StreamFilterManager interface { | ||
| // StoreFilter is store a filter by uuid and it usually occurs during the | ||
| // every new stream filter constructor phase. | ||
| // The uuid is created during filter constructor phase. | ||
| StoreFilter(uuid uint64, filter StreamFilter) | ||
| // GetFilter is get a filter by uuid and use to call the filter's decodeHeader | ||
| // decodeData etc. | ||
| GetFilter(uuid uint64) StreamFilter | ||
| // DeleteFilter remove a stream filter by uuid and it usually occurs during | ||
| // the stream filter destructor phase. | ||
| DeleteFilter(uuid uint64) | ||
| } | ||
|
|
||
| //***************** filter manager end *****************// |
This file contains hidden or 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,3 @@ | ||
| module plugin | ||
|
|
||
| go 1.14 |
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.
Uh oh!
There was an error while loading. Please reload this page.