forked from envoyproxy/envoy
-
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.
api: add bootstrap extensions (envoyproxy#11413)
Commit Message: Adds a configurable server wide extension hook point. Allow extensions to instantiate singletons / context managers with configs in bootstrap. Additional Description: Risk Level: Low (not used API) Testing: unittest, mock Docs Changes: protodoc Release Notes: N/A as no real extension lives today. Fixes envoyproxy#11219 Signed-off-by: Lizan Zhou <[email protected]>
- Loading branch information
Showing
15 changed files
with
166 additions
and
4 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
7 changes: 6 additions & 1 deletion
7
generated_api_shadow/envoy/config/bootstrap/v3/bootstrap.proto
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
7 changes: 6 additions & 1 deletion
7
generated_api_shadow/envoy/config/bootstrap/v4alpha/bootstrap.proto
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,47 @@ | ||
#pragma once | ||
|
||
#include <memory> | ||
|
||
#include "envoy/server/filter_config.h" | ||
|
||
#include "common/protobuf/protobuf.h" | ||
|
||
namespace Envoy { | ||
namespace Server { | ||
|
||
/** | ||
* Parent class for bootstrap extensions. | ||
*/ | ||
class BootstrapExtension { | ||
public: | ||
virtual ~BootstrapExtension() = default; | ||
}; | ||
|
||
using BootstrapExtensionPtr = std::unique_ptr<BootstrapExtension>; | ||
|
||
namespace Configuration { | ||
|
||
/** | ||
* Implemented for each bootstrap extension and registered via Registry::registerFactory or the | ||
* convenience class RegisterFactory. | ||
*/ | ||
class BootstrapExtensionFactory : public Config::TypedFactory { | ||
public: | ||
~BootstrapExtensionFactory() override = default; | ||
|
||
/** | ||
* Create a particular bootstrap extension implementation from a config proto. If the | ||
* implementation is unable to produce a factory with the provided parameters, it should throw an | ||
* EnvoyException. The returned pointer should never be nullptr. | ||
* @param config the custom configuration for this bootstrap extension type. | ||
* @param context general filter context through which persistent resources can be accessed. | ||
*/ | ||
virtual BootstrapExtensionPtr createBootstrapExtension(const Protobuf::Message& config, | ||
ServerFactoryContext& context) PURE; | ||
|
||
std::string category() const override { return "envoy.bootstrap"; } | ||
}; | ||
|
||
} // namespace Configuration | ||
} // namespace Server | ||
} // namespace Envoy |
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
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,5 @@ | ||
bootstrap_extensions: | ||
- name: envoy_test.bootstrap.foo | ||
typed_config: | ||
"@type": type.googleapis.com/test.common.config.DummyConfig | ||
a: foo |