io.envoyproxy.envoy.extensions.wasm.v3.VmConfig.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of envoy-scala-control-plane_2.13 Show documentation
Show all versions of envoy-scala-control-plane_2.13 Show documentation
ScalaPB generated bindings for Envoy
// Generated by the Scala Plugin for the Protocol Buffer Compiler.
// Do not edit!
//
// Protofile syntax: PROTO3
package io.envoyproxy.envoy.extensions.wasm.v3
/** Configuration for a Wasm VM.
* [#next-free-field: 8]
*
* @param vmId
* An ID which will be used along with a hash of the wasm code (or the name of the registered Null
* VM plugin) to determine which VM will be used for the plugin. All plugins which use the same
* *vm_id* and code will use the same VM. May be left blank. Sharing a VM between plugins can
* reduce memory utilization and make sharing of data easier which may have security implications.
* [#comment: TODO: add ref for details.]
* @param runtime
* The Wasm runtime type.
* Available Wasm runtime types are registered as extensions. The following runtimes are included
* in Envoy code base:
*
* .. _extension_envoy.wasm.runtime.null:
*
* **envoy.wasm.runtime.null**: Null sandbox, the Wasm module must be compiled and linked into the
* Envoy binary. The registered name is given in the *code* field as *inline_string*.
*
* .. _extension_envoy.wasm.runtime.v8:
*
* **envoy.wasm.runtime.v8**: `V8 <https://v8.dev/>`_-based WebAssembly runtime.
*
* .. _extension_envoy.wasm.runtime.wamr:
*
* **envoy.wasm.runtime.wamr**: `WAMR <https://github.com/bytecodealliance/wasm-micro-runtime/>`_-based WebAssembly runtime.
* This runtime is not enabled in the official build.
*
* .. _extension_envoy.wasm.runtime.wavm:
*
* **envoy.wasm.runtime.wavm**: `WAVM <https://wavm.github.io/>`_-based WebAssembly runtime.
* This runtime is not enabled in the official build.
*
* .. _extension_envoy.wasm.runtime.wasmtime:
*
* **envoy.wasm.runtime.wasmtime**: `Wasmtime <https://wasmtime.dev/>`_-based WebAssembly runtime.
* This runtime is not enabled in the official build.
*
* [#extension-category: envoy.wasm.runtime]
* @param code
* The Wasm code that Envoy will execute.
* @param configuration
* The Wasm configuration used in initialization of a new VM
* (proxy_on_start). `google.protobuf.Struct` is serialized as JSON before
* passing it to the plugin. `google.protobuf.BytesValue` and
* `google.protobuf.StringValue` are passed directly without the wrapper.
* @param allowPrecompiled
* Allow the wasm file to include pre-compiled code on VMs which support it.
* Warning: this should only be enable for trusted sources as the precompiled code is not
* verified.
* @param nackOnCodeCacheMiss
* If true and the code needs to be remotely fetched and it is not in the cache then NACK the configuration
* update and do a background fetch to fill the cache, otherwise fetch the code asynchronously and enter
* warming state.
* @param environmentVariables
* Specifies environment variables to be injected to this VM which will be available through
* WASI's ``environ_get`` and ``environ_get_sizes`` system calls. Note that these functions are mostly implicitly
* called in your language's standard library, so you do not need to call them directly and you can access to env
* vars just like when you do on native platforms.
* Warning: Envoy rejects the configuration if there's conflict of key space.
*/
@SerialVersionUID(0L)
final case class VmConfig(
vmId: _root_.scala.Predef.String = "",
runtime: _root_.scala.Predef.String = "",
code: _root_.scala.Option[io.envoyproxy.envoy.config.core.v3.AsyncDataSource] = _root_.scala.None,
configuration: _root_.scala.Option[com.google.protobuf.any.Any] = _root_.scala.None,
allowPrecompiled: _root_.scala.Boolean = false,
nackOnCodeCacheMiss: _root_.scala.Boolean = false,
environmentVariables: _root_.scala.Option[io.envoyproxy.envoy.extensions.wasm.v3.EnvironmentVariables] = _root_.scala.None,
unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty
) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[VmConfig] {
@transient
private[this] var __serializedSizeMemoized: _root_.scala.Int = 0
private[this] def __computeSerializedSize(): _root_.scala.Int = {
var __size = 0
{
val __value = vmId
if (!__value.isEmpty) {
__size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(1, __value)
}
};
{
val __value = runtime
if (!__value.isEmpty) {
__size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(2, __value)
}
};
if (code.isDefined) {
val __value = code.get
__size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
};
if (configuration.isDefined) {
val __value = configuration.get
__size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
};
{
val __value = allowPrecompiled
if (__value != false) {
__size += _root_.com.google.protobuf.CodedOutputStream.computeBoolSize(5, __value)
}
};
{
val __value = nackOnCodeCacheMiss
if (__value != false) {
__size += _root_.com.google.protobuf.CodedOutputStream.computeBoolSize(6, __value)
}
};
if (environmentVariables.isDefined) {
val __value = environmentVariables.get
__size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
};
__size += unknownFields.serializedSize
__size
}
override def serializedSize: _root_.scala.Int = {
var __size = __serializedSizeMemoized
if (__size == 0) {
__size = __computeSerializedSize() + 1
__serializedSizeMemoized = __size
}
__size - 1
}
def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = {
{
val __v = vmId
if (!__v.isEmpty) {
_output__.writeString(1, __v)
}
};
{
val __v = runtime
if (!__v.isEmpty) {
_output__.writeString(2, __v)
}
};
code.foreach { __v =>
val __m = __v
_output__.writeTag(3, 2)
_output__.writeUInt32NoTag(__m.serializedSize)
__m.writeTo(_output__)
};
configuration.foreach { __v =>
val __m = __v
_output__.writeTag(4, 2)
_output__.writeUInt32NoTag(__m.serializedSize)
__m.writeTo(_output__)
};
{
val __v = allowPrecompiled
if (__v != false) {
_output__.writeBool(5, __v)
}
};
{
val __v = nackOnCodeCacheMiss
if (__v != false) {
_output__.writeBool(6, __v)
}
};
environmentVariables.foreach { __v =>
val __m = __v
_output__.writeTag(7, 2)
_output__.writeUInt32NoTag(__m.serializedSize)
__m.writeTo(_output__)
};
unknownFields.writeTo(_output__)
}
def withVmId(__v: _root_.scala.Predef.String): VmConfig = copy(vmId = __v)
def withRuntime(__v: _root_.scala.Predef.String): VmConfig = copy(runtime = __v)
def getCode: io.envoyproxy.envoy.config.core.v3.AsyncDataSource = code.getOrElse(io.envoyproxy.envoy.config.core.v3.AsyncDataSource.defaultInstance)
def clearCode: VmConfig = copy(code = _root_.scala.None)
def withCode(__v: io.envoyproxy.envoy.config.core.v3.AsyncDataSource): VmConfig = copy(code = Option(__v))
def getConfiguration: com.google.protobuf.any.Any = configuration.getOrElse(com.google.protobuf.any.Any.defaultInstance)
def clearConfiguration: VmConfig = copy(configuration = _root_.scala.None)
def withConfiguration(__v: com.google.protobuf.any.Any): VmConfig = copy(configuration = Option(__v))
def withAllowPrecompiled(__v: _root_.scala.Boolean): VmConfig = copy(allowPrecompiled = __v)
def withNackOnCodeCacheMiss(__v: _root_.scala.Boolean): VmConfig = copy(nackOnCodeCacheMiss = __v)
def getEnvironmentVariables: io.envoyproxy.envoy.extensions.wasm.v3.EnvironmentVariables = environmentVariables.getOrElse(io.envoyproxy.envoy.extensions.wasm.v3.EnvironmentVariables.defaultInstance)
def clearEnvironmentVariables: VmConfig = copy(environmentVariables = _root_.scala.None)
def withEnvironmentVariables(__v: io.envoyproxy.envoy.extensions.wasm.v3.EnvironmentVariables): VmConfig = copy(environmentVariables = Option(__v))
def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v)
def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty)
def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = {
(__fieldNumber: @_root_.scala.unchecked) match {
case 1 => {
val __t = vmId
if (__t != "") __t else null
}
case 2 => {
val __t = runtime
if (__t != "") __t else null
}
case 3 => code.orNull
case 4 => configuration.orNull
case 5 => {
val __t = allowPrecompiled
if (__t != false) __t else null
}
case 6 => {
val __t = nackOnCodeCacheMiss
if (__t != false) __t else null
}
case 7 => environmentVariables.orNull
}
}
def getField(__field: _root_.scalapb.descriptors.FieldDescriptor): _root_.scalapb.descriptors.PValue = {
_root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor)
(__field.number: @_root_.scala.unchecked) match {
case 1 => _root_.scalapb.descriptors.PString(vmId)
case 2 => _root_.scalapb.descriptors.PString(runtime)
case 3 => code.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
case 4 => configuration.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
case 5 => _root_.scalapb.descriptors.PBoolean(allowPrecompiled)
case 6 => _root_.scalapb.descriptors.PBoolean(nackOnCodeCacheMiss)
case 7 => environmentVariables.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
}
}
def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this)
def companion: io.envoyproxy.envoy.extensions.wasm.v3.VmConfig.type = io.envoyproxy.envoy.extensions.wasm.v3.VmConfig
// @@protoc_insertion_point(GeneratedMessage[envoy.extensions.wasm.v3.VmConfig])
}
object VmConfig extends scalapb.GeneratedMessageCompanion[io.envoyproxy.envoy.extensions.wasm.v3.VmConfig] {
implicit def messageCompanion: scalapb.GeneratedMessageCompanion[io.envoyproxy.envoy.extensions.wasm.v3.VmConfig] = this
def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): io.envoyproxy.envoy.extensions.wasm.v3.VmConfig = {
var __vmId: _root_.scala.Predef.String = ""
var __runtime: _root_.scala.Predef.String = ""
var __code: _root_.scala.Option[io.envoyproxy.envoy.config.core.v3.AsyncDataSource] = _root_.scala.None
var __configuration: _root_.scala.Option[com.google.protobuf.any.Any] = _root_.scala.None
var __allowPrecompiled: _root_.scala.Boolean = false
var __nackOnCodeCacheMiss: _root_.scala.Boolean = false
var __environmentVariables: _root_.scala.Option[io.envoyproxy.envoy.extensions.wasm.v3.EnvironmentVariables] = _root_.scala.None
var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null
var _done__ = false
while (!_done__) {
val _tag__ = _input__.readTag()
_tag__ match {
case 0 => _done__ = true
case 10 =>
__vmId = _input__.readStringRequireUtf8()
case 18 =>
__runtime = _input__.readStringRequireUtf8()
case 26 =>
__code = Option(__code.fold(_root_.scalapb.LiteParser.readMessage[io.envoyproxy.envoy.config.core.v3.AsyncDataSource](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
case 34 =>
__configuration = Option(__configuration.fold(_root_.scalapb.LiteParser.readMessage[com.google.protobuf.any.Any](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
case 40 =>
__allowPrecompiled = _input__.readBool()
case 48 =>
__nackOnCodeCacheMiss = _input__.readBool()
case 58 =>
__environmentVariables = Option(__environmentVariables.fold(_root_.scalapb.LiteParser.readMessage[io.envoyproxy.envoy.extensions.wasm.v3.EnvironmentVariables](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
case tag =>
if (_unknownFields__ == null) {
_unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder()
}
_unknownFields__.parseField(tag, _input__)
}
}
io.envoyproxy.envoy.extensions.wasm.v3.VmConfig(
vmId = __vmId,
runtime = __runtime,
code = __code,
configuration = __configuration,
allowPrecompiled = __allowPrecompiled,
nackOnCodeCacheMiss = __nackOnCodeCacheMiss,
environmentVariables = __environmentVariables,
unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result()
)
}
implicit def messageReads: _root_.scalapb.descriptors.Reads[io.envoyproxy.envoy.extensions.wasm.v3.VmConfig] = _root_.scalapb.descriptors.Reads{
case _root_.scalapb.descriptors.PMessage(__fieldsMap) =>
_root_.scala.Predef.require(__fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), "FieldDescriptor does not match message type.")
io.envoyproxy.envoy.extensions.wasm.v3.VmConfig(
vmId = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""),
runtime = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""),
code = __fieldsMap.get(scalaDescriptor.findFieldByNumber(3).get).flatMap(_.as[_root_.scala.Option[io.envoyproxy.envoy.config.core.v3.AsyncDataSource]]),
configuration = __fieldsMap.get(scalaDescriptor.findFieldByNumber(4).get).flatMap(_.as[_root_.scala.Option[com.google.protobuf.any.Any]]),
allowPrecompiled = __fieldsMap.get(scalaDescriptor.findFieldByNumber(5).get).map(_.as[_root_.scala.Boolean]).getOrElse(false),
nackOnCodeCacheMiss = __fieldsMap.get(scalaDescriptor.findFieldByNumber(6).get).map(_.as[_root_.scala.Boolean]).getOrElse(false),
environmentVariables = __fieldsMap.get(scalaDescriptor.findFieldByNumber(7).get).flatMap(_.as[_root_.scala.Option[io.envoyproxy.envoy.extensions.wasm.v3.EnvironmentVariables]])
)
case _ => throw new RuntimeException("Expected PMessage")
}
def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = WasmProto.javaDescriptor.getMessageTypes().get(2)
def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = WasmProto.scalaDescriptor.messages(2)
def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = {
var __out: _root_.scalapb.GeneratedMessageCompanion[_] = null
(__number: @_root_.scala.unchecked) match {
case 3 => __out = io.envoyproxy.envoy.config.core.v3.AsyncDataSource
case 4 => __out = com.google.protobuf.any.Any
case 7 => __out = io.envoyproxy.envoy.extensions.wasm.v3.EnvironmentVariables
}
__out
}
lazy val nestedMessagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = Seq.empty
def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[_] = throw new MatchError(__fieldNumber)
lazy val defaultInstance = io.envoyproxy.envoy.extensions.wasm.v3.VmConfig(
vmId = "",
runtime = "",
code = _root_.scala.None,
configuration = _root_.scala.None,
allowPrecompiled = false,
nackOnCodeCacheMiss = false,
environmentVariables = _root_.scala.None
)
implicit class VmConfigLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, io.envoyproxy.envoy.extensions.wasm.v3.VmConfig]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, io.envoyproxy.envoy.extensions.wasm.v3.VmConfig](_l) {
def vmId: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.vmId)((c_, f_) => c_.copy(vmId = f_))
def runtime: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.runtime)((c_, f_) => c_.copy(runtime = f_))
def code: _root_.scalapb.lenses.Lens[UpperPB, io.envoyproxy.envoy.config.core.v3.AsyncDataSource] = field(_.getCode)((c_, f_) => c_.copy(code = Option(f_)))
def optionalCode: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[io.envoyproxy.envoy.config.core.v3.AsyncDataSource]] = field(_.code)((c_, f_) => c_.copy(code = f_))
def configuration: _root_.scalapb.lenses.Lens[UpperPB, com.google.protobuf.any.Any] = field(_.getConfiguration)((c_, f_) => c_.copy(configuration = Option(f_)))
def optionalConfiguration: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[com.google.protobuf.any.Any]] = field(_.configuration)((c_, f_) => c_.copy(configuration = f_))
def allowPrecompiled: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Boolean] = field(_.allowPrecompiled)((c_, f_) => c_.copy(allowPrecompiled = f_))
def nackOnCodeCacheMiss: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Boolean] = field(_.nackOnCodeCacheMiss)((c_, f_) => c_.copy(nackOnCodeCacheMiss = f_))
def environmentVariables: _root_.scalapb.lenses.Lens[UpperPB, io.envoyproxy.envoy.extensions.wasm.v3.EnvironmentVariables] = field(_.getEnvironmentVariables)((c_, f_) => c_.copy(environmentVariables = Option(f_)))
def optionalEnvironmentVariables: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[io.envoyproxy.envoy.extensions.wasm.v3.EnvironmentVariables]] = field(_.environmentVariables)((c_, f_) => c_.copy(environmentVariables = f_))
}
final val VM_ID_FIELD_NUMBER = 1
final val RUNTIME_FIELD_NUMBER = 2
final val CODE_FIELD_NUMBER = 3
final val CONFIGURATION_FIELD_NUMBER = 4
final val ALLOW_PRECOMPILED_FIELD_NUMBER = 5
final val NACK_ON_CODE_CACHE_MISS_FIELD_NUMBER = 6
final val ENVIRONMENT_VARIABLES_FIELD_NUMBER = 7
def of(
vmId: _root_.scala.Predef.String,
runtime: _root_.scala.Predef.String,
code: _root_.scala.Option[io.envoyproxy.envoy.config.core.v3.AsyncDataSource],
configuration: _root_.scala.Option[com.google.protobuf.any.Any],
allowPrecompiled: _root_.scala.Boolean,
nackOnCodeCacheMiss: _root_.scala.Boolean,
environmentVariables: _root_.scala.Option[io.envoyproxy.envoy.extensions.wasm.v3.EnvironmentVariables]
): _root_.io.envoyproxy.envoy.extensions.wasm.v3.VmConfig = _root_.io.envoyproxy.envoy.extensions.wasm.v3.VmConfig(
vmId,
runtime,
code,
configuration,
allowPrecompiled,
nackOnCodeCacheMiss,
environmentVariables
)
// @@protoc_insertion_point(GeneratedMessageCompanion[envoy.extensions.wasm.v3.VmConfig])
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy