thrift_to_metadatav3

package
v1.36.11-2026042420273... Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: unknown License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Field_name = map[int32]string{
		0: "METHOD_NAME",
		1: "PROTOCOL",
		2: "TRANSPORT",
		3: "HEADER_FLAGS",
		4: "SEQUENCE_ID",
		5: "MESSAGE_TYPE",
		6: "REPLY_TYPE",
	}
	Field_value = map[string]int32{
		"METHOD_NAME":  0,
		"PROTOCOL":     1,
		"TRANSPORT":    2,
		"HEADER_FLAGS": 3,
		"SEQUENCE_ID":  4,
		"MESSAGE_TYPE": 5,
		"REPLY_TYPE":   6,
	}
)

Enum value maps for Field.

View Source
var File_envoy_extensions_filters_http_thrift_to_metadata_v3_thrift_to_metadata_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Field

type Field int32
const (
	// The Thrift method name, string value.
	Field_METHOD_NAME Field = 0
	// The Thrift protocol name, string value. Values are "binary", "binary/non-strict", and "compact", with "(auto)" suffix if
	// :ref:`protocol <envoy_v3_api_field_extensions.filters.http.thrift_to_metadata.v3.ThriftToMetadata.protocol>`
	// is set to :ref:`AUTO_PROTOCOL<envoy_v3_api_enum_value_extensions.filters.network.thrift_proxy.v3.ProtocolType.AUTO_PROTOCOL>`
	Field_PROTOCOL Field = 1
	// The Thrift transport name, string value. Values are "framed", "header", and "unframed", with "(auto)" suffix if
	// :ref:`transport <envoy_v3_api_field_extensions.filters.http.thrift_to_metadata.v3.ThriftToMetadata.transport>`
	// is set to :ref:`AUTO_TRANSPORT<envoy_v3_api_enum_value_extensions.filters.network.thrift_proxy.v3.TransportType.AUTO_TRANSPORT>`
	Field_TRANSPORT Field = 2
	// The Thrift message type, singed 16-bit integer value.
	Field_HEADER_FLAGS Field = 3
	// The Thrift sequence ID, singed 32-bit integer value.
	Field_SEQUENCE_ID Field = 4
	// The Thrift message type, string value. Values in request are "call" and "oneway", and in response are "reply" and "exception".
	Field_MESSAGE_TYPE Field = 5
	// The Thrift reply type, string value. This is only valid for response rules. Values are "success" and "error".
	Field_REPLY_TYPE Field = 6
)

func (Field) Descriptor

func (Field) Descriptor() protoreflect.EnumDescriptor

func (Field) Enum

func (x Field) Enum() *Field

func (Field) Number

func (x Field) Number() protoreflect.EnumNumber

func (Field) String

func (x Field) String() string

func (Field) Type

func (Field) Type() protoreflect.EnumType

type FieldSelector

type FieldSelector struct {

	// field name to log
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// field id to match
	Id int32 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"`
	// next node of the field selector
	Child *FieldSelector `protobuf:"bytes,3,opt,name=child,proto3" json:"child,omitempty"`
	// contains filtered or unexported fields
}

func (*FieldSelector) ClearChild

func (x *FieldSelector) ClearChild()

func (*FieldSelector) GetChild

func (x *FieldSelector) GetChild() *FieldSelector

func (*FieldSelector) GetId

func (x *FieldSelector) GetId() int32

func (*FieldSelector) GetName

func (x *FieldSelector) GetName() string

func (*FieldSelector) HasChild

func (x *FieldSelector) HasChild() bool

func (*FieldSelector) ProtoMessage

func (*FieldSelector) ProtoMessage()

func (*FieldSelector) ProtoReflect

func (x *FieldSelector) ProtoReflect() protoreflect.Message

func (*FieldSelector) Reset

func (x *FieldSelector) Reset()

func (*FieldSelector) SetChild

func (x *FieldSelector) SetChild(v *FieldSelector)

func (*FieldSelector) SetId

func (x *FieldSelector) SetId(v int32)

func (*FieldSelector) SetName

func (x *FieldSelector) SetName(v string)

func (*FieldSelector) String

func (x *FieldSelector) String() string

type FieldSelector_builder

type FieldSelector_builder struct {

	// field name to log
	Name string
	// field id to match
	Id int32
	// next node of the field selector
	Child *FieldSelector
	// contains filtered or unexported fields
}

func (FieldSelector_builder) Build

type KeyValuePair

type KeyValuePair struct {

	// The namespace — if this is empty, the filter's namespace will be used.
	MetadataNamespace string `protobuf:"bytes,1,opt,name=metadata_namespace,json=metadataNamespace,proto3" json:"metadata_namespace,omitempty"`
	// The key to use within the namespace.
	Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
	// When used for on_present case, if value is non-empty it'll be used instead
	// of the field value.
	//
	// When used for on_missing case, a non-empty value must be provided.
	Value *structpb.Value `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*KeyValuePair) ClearValue

func (x *KeyValuePair) ClearValue()

func (*KeyValuePair) GetKey

func (x *KeyValuePair) GetKey() string

func (*KeyValuePair) GetMetadataNamespace

func (x *KeyValuePair) GetMetadataNamespace() string

func (*KeyValuePair) GetValue

func (x *KeyValuePair) GetValue() *structpb.Value

func (*KeyValuePair) HasValue

func (x *KeyValuePair) HasValue() bool

func (*KeyValuePair) ProtoMessage

func (*KeyValuePair) ProtoMessage()

func (*KeyValuePair) ProtoReflect

func (x *KeyValuePair) ProtoReflect() protoreflect.Message

func (*KeyValuePair) Reset

func (x *KeyValuePair) Reset()

func (*KeyValuePair) SetKey

func (x *KeyValuePair) SetKey(v string)

func (*KeyValuePair) SetMetadataNamespace

func (x *KeyValuePair) SetMetadataNamespace(v string)

func (*KeyValuePair) SetValue

func (x *KeyValuePair) SetValue(v *structpb.Value)

func (*KeyValuePair) String

func (x *KeyValuePair) String() string

type KeyValuePair_builder

type KeyValuePair_builder struct {

	// The namespace — if this is empty, the filter's namespace will be used.
	MetadataNamespace string
	// The key to use within the namespace.
	Key string
	// When used for on_present case, if value is non-empty it'll be used instead
	// of the field value.
	//
	// When used for on_missing case, a non-empty value must be provided.
	Value *structpb.Value
	// contains filtered or unexported fields
}

func (KeyValuePair_builder) Build

func (b0 KeyValuePair_builder) Build() *KeyValuePair

type Rule

type Rule struct {

	// The field to match on.
	// :ref:`field_selector<envoy_v3_api_field_extensions.filters.http.thrift_to_metadata.v3.Rule.field_selector>`
	// takes precedence if both are set.
	Field Field `` /* 127-byte string literal not displayed */
	// Specifies that a match will be performed on the value of a field in the thrift body.
	// If set, the whole http body will be buffered to extract the field value, which
	// may have performance implications.
	//
	// It's a thrift over http version of
	// :ref:`field_selector<envoy_v3_api_field_extensions.filters.network.thrift_proxy.filters.payload_to_metadata.v3.PayloadToMetadata.Rule.field_selector>`.
	//
	// See also `payload-to-metadata <https://www.envoyproxy.io/docs/envoy/latest/configuration/other_protocols/thrift_filters/payload_to_metadata_filter>`_
	// for more reference.
	//
	// Example:
	//
	// .. code-block:: yaml
	//
	//	method_name: foo
	//	field_selector:
	//	  name: info
	//	  id: 2
	//	  child:
	//	    name: version
	//	    id: 1
	//
	// The above yaml will match on value of “info.version“ in the below thrift schema as input of
	// :ref:`on_present<envoy_v3_api_field_extensions.filters.http.thrift_to_metadata.v3.Rule.on_present>` or
	// :ref:`on_missing<envoy_v3_api_field_extensions.filters.http.thrift_to_metadata.v3.Rule.on_missing>`
	// while we are processing “foo“ method. This rule won't be applied to “bar“ method.
	//
	// .. code-block:: thrift
	//
	//	struct Info {
	//	  1: required string version;
	//	}
	//	service Server {
	//	  bool foo(1: i32 id, 2: Info info);
	//	  bool bar(1: i32 id, 2: Info info);
	//	}
	FieldSelector *FieldSelector `protobuf:"bytes,2,opt,name=field_selector,json=fieldSelector,proto3" json:"field_selector,omitempty"`
	// If specified, :ref:`field_selector<envoy_v3_api_field_extensions.filters.http.thrift_to_metadata.v3.Rule.field_selector>`
	// will be used to extract the field value *only* on the thrift message with method name.
	MethodName string `protobuf:"bytes,3,opt,name=method_name,json=methodName,proto3" json:"method_name,omitempty"`
	// The key-value pair to set in the *filter metadata* if the field is present
	// in *thrift metadata*.
	//
	// If the value in the KeyValuePair is non-empty, it'll be used instead
	// of field value.
	OnPresent *KeyValuePair `protobuf:"bytes,4,opt,name=on_present,json=onPresent,proto3" json:"on_present,omitempty"`
	// The key-value pair to set in the *filter metadata* if the field is missing
	// in *thrift metadata*.
	//
	// The value in the KeyValuePair must be set, since it'll be used in lieu
	// of the missing field value.
	OnMissing *KeyValuePair `protobuf:"bytes,5,opt,name=on_missing,json=onMissing,proto3" json:"on_missing,omitempty"`
	// contains filtered or unexported fields
}

[#next-free-field: 6]

func (*Rule) ClearFieldSelector

func (x *Rule) ClearFieldSelector()

func (*Rule) ClearOnMissing

func (x *Rule) ClearOnMissing()

func (*Rule) ClearOnPresent

func (x *Rule) ClearOnPresent()

func (*Rule) GetField

func (x *Rule) GetField() Field

func (*Rule) GetFieldSelector

func (x *Rule) GetFieldSelector() *FieldSelector

func (*Rule) GetMethodName

func (x *Rule) GetMethodName() string

func (*Rule) GetOnMissing

func (x *Rule) GetOnMissing() *KeyValuePair

func (*Rule) GetOnPresent

func (x *Rule) GetOnPresent() *KeyValuePair

func (*Rule) HasFieldSelector

func (x *Rule) HasFieldSelector() bool

func (*Rule) HasOnMissing

func (x *Rule) HasOnMissing() bool

func (*Rule) HasOnPresent

func (x *Rule) HasOnPresent() bool

func (*Rule) ProtoMessage

func (*Rule) ProtoMessage()

func (*Rule) ProtoReflect

func (x *Rule) ProtoReflect() protoreflect.Message

func (*Rule) Reset

func (x *Rule) Reset()

func (*Rule) SetField

func (x *Rule) SetField(v Field)

func (*Rule) SetFieldSelector

func (x *Rule) SetFieldSelector(v *FieldSelector)

func (*Rule) SetMethodName

func (x *Rule) SetMethodName(v string)

func (*Rule) SetOnMissing

func (x *Rule) SetOnMissing(v *KeyValuePair)

func (*Rule) SetOnPresent

func (x *Rule) SetOnPresent(v *KeyValuePair)

func (*Rule) String

func (x *Rule) String() string

type Rule_builder

type Rule_builder struct {

	// The field to match on.
	// :ref:`field_selector<envoy_v3_api_field_extensions.filters.http.thrift_to_metadata.v3.Rule.field_selector>`
	// takes precedence if both are set.
	Field Field
	// Specifies that a match will be performed on the value of a field in the thrift body.
	// If set, the whole http body will be buffered to extract the field value, which
	// may have performance implications.
	//
	// It's a thrift over http version of
	// :ref:`field_selector<envoy_v3_api_field_extensions.filters.network.thrift_proxy.filters.payload_to_metadata.v3.PayloadToMetadata.Rule.field_selector>`.
	//
	// See also `payload-to-metadata <https://www.envoyproxy.io/docs/envoy/latest/configuration/other_protocols/thrift_filters/payload_to_metadata_filter>`_
	// for more reference.
	//
	// Example:
	//
	// .. code-block:: yaml
	//
	//	method_name: foo
	//	field_selector:
	//	  name: info
	//	  id: 2
	//	  child:
	//	    name: version
	//	    id: 1
	//
	// The above yaml will match on value of “info.version“ in the below thrift schema as input of
	// :ref:`on_present<envoy_v3_api_field_extensions.filters.http.thrift_to_metadata.v3.Rule.on_present>` or
	// :ref:`on_missing<envoy_v3_api_field_extensions.filters.http.thrift_to_metadata.v3.Rule.on_missing>`
	// while we are processing “foo“ method. This rule won't be applied to “bar“ method.
	//
	// .. code-block:: thrift
	//
	//	struct Info {
	//	  1: required string version;
	//	}
	//	service Server {
	//	  bool foo(1: i32 id, 2: Info info);
	//	  bool bar(1: i32 id, 2: Info info);
	//	}
	FieldSelector *FieldSelector
	// If specified, :ref:`field_selector<envoy_v3_api_field_extensions.filters.http.thrift_to_metadata.v3.Rule.field_selector>`
	// will be used to extract the field value *only* on the thrift message with method name.
	MethodName string
	// The key-value pair to set in the *filter metadata* if the field is present
	// in *thrift metadata*.
	//
	// If the value in the KeyValuePair is non-empty, it'll be used instead
	// of field value.
	OnPresent *KeyValuePair
	// The key-value pair to set in the *filter metadata* if the field is missing
	// in *thrift metadata*.
	//
	// The value in the KeyValuePair must be set, since it'll be used in lieu
	// of the missing field value.
	OnMissing *KeyValuePair
	// contains filtered or unexported fields
}

func (Rule_builder) Build

func (b0 Rule_builder) Build() *Rule

type ThriftToMetadata

type ThriftToMetadata struct {

	// The list of rules to apply to http request body to extract thrift metadata.
	RequestRules []*Rule `protobuf:"bytes,1,rep,name=request_rules,json=requestRules,proto3" json:"request_rules,omitempty"`
	// The list of rules to apply to http response body to extract thrift metadata.
	ResponseRules []*Rule `protobuf:"bytes,2,rep,name=response_rules,json=responseRules,proto3" json:"response_rules,omitempty"`
	// Supplies the type of transport that the Thrift proxy should use. Defaults to
	// :ref:`AUTO_TRANSPORT<envoy_v3_api_enum_value_extensions.filters.network.thrift_proxy.v3.TransportType.AUTO_TRANSPORT>`.
	Transport v3.TransportType `` /* 140-byte string literal not displayed */
	// Supplies the type of protocol that the Thrift proxy should use. Defaults to
	// :ref:`AUTO_PROTOCOL<envoy_v3_api_enum_value_extensions.filters.network.thrift_proxy.v3.ProtocolType.AUTO_PROTOCOL>`.
	// Note that :ref:`LAX_BINARY<envoy_v3_api_enum_value_extensions.filters.network.thrift_proxy.v3.ProtocolType.LAX_BINARY>`
	// is not distinguished by :ref:`AUTO_PROTOCOL<envoy_v3_api_enum_value_extensions.filters.network.thrift_proxy.v3.ProtocolType.AUTO_PROTOCOL>`,
	// which is the same with :ref:`thrift_proxy network filter <envoy_v3_api_msg_extensions.filters.network.thrift_proxy.v3.ThriftProxy>`.
	// Note that :ref:`TWITTER<envoy_v3_api_enum_value_extensions.filters.network.thrift_proxy.v3.ProtocolType.TWITTER>` is
	// not supported due to deprecation in envoy.
	Protocol v3.ProtocolType `` /* 137-byte string literal not displayed */
	// Allowed content-type for thrift payload to filter metadata transformation.
	// Default to “{"application/x-thrift"}“.
	//
	// Set “allow_empty_content_type“ if empty/missing content-type header
	// is allowed.
	AllowContentTypes []string `protobuf:"bytes,5,rep,name=allow_content_types,json=allowContentTypes,proto3" json:"allow_content_types,omitempty"`
	// Allowed empty content-type for thrift payload to filter metadata transformation.
	// Default to false.
	AllowEmptyContentType bool `` /* 129-byte string literal not displayed */
	// contains filtered or unexported fields
}

The configuration for transforming thrift metadata into filter metadata.

[#next-free-field: 7]

func (*ThriftToMetadata) GetAllowContentTypes

func (x *ThriftToMetadata) GetAllowContentTypes() []string

func (*ThriftToMetadata) GetAllowEmptyContentType

func (x *ThriftToMetadata) GetAllowEmptyContentType() bool

func (*ThriftToMetadata) GetProtocol

func (x *ThriftToMetadata) GetProtocol() v3.ProtocolType

func (*ThriftToMetadata) GetRequestRules

func (x *ThriftToMetadata) GetRequestRules() []*Rule

func (*ThriftToMetadata) GetResponseRules

func (x *ThriftToMetadata) GetResponseRules() []*Rule

func (*ThriftToMetadata) GetTransport

func (x *ThriftToMetadata) GetTransport() v3.TransportType

func (*ThriftToMetadata) ProtoMessage

func (*ThriftToMetadata) ProtoMessage()

func (*ThriftToMetadata) ProtoReflect

func (x *ThriftToMetadata) ProtoReflect() protoreflect.Message

func (*ThriftToMetadata) Reset

func (x *ThriftToMetadata) Reset()

func (*ThriftToMetadata) SetAllowContentTypes

func (x *ThriftToMetadata) SetAllowContentTypes(v []string)

func (*ThriftToMetadata) SetAllowEmptyContentType

func (x *ThriftToMetadata) SetAllowEmptyContentType(v bool)

func (*ThriftToMetadata) SetProtocol

func (x *ThriftToMetadata) SetProtocol(v v3.ProtocolType)

func (*ThriftToMetadata) SetRequestRules

func (x *ThriftToMetadata) SetRequestRules(v []*Rule)

func (*ThriftToMetadata) SetResponseRules

func (x *ThriftToMetadata) SetResponseRules(v []*Rule)

func (*ThriftToMetadata) SetTransport

func (x *ThriftToMetadata) SetTransport(v v3.TransportType)

func (*ThriftToMetadata) String

func (x *ThriftToMetadata) String() string

type ThriftToMetadataPerRoute

type ThriftToMetadataPerRoute struct {

	// The list of rules to apply to http request body to extract thrift metadata.
	RequestRules []*Rule `protobuf:"bytes,1,rep,name=request_rules,json=requestRules,proto3" json:"request_rules,omitempty"`
	// The list of rules to apply to http response body to extract thrift metadata.
	ResponseRules []*Rule `protobuf:"bytes,2,rep,name=response_rules,json=responseRules,proto3" json:"response_rules,omitempty"`
	// contains filtered or unexported fields
}

Thrift to metadata configuration on a per-route basis, which overrides the global configuration for request rules and responses rules.

func (*ThriftToMetadataPerRoute) GetRequestRules

func (x *ThriftToMetadataPerRoute) GetRequestRules() []*Rule

func (*ThriftToMetadataPerRoute) GetResponseRules

func (x *ThriftToMetadataPerRoute) GetResponseRules() []*Rule

func (*ThriftToMetadataPerRoute) ProtoMessage

func (*ThriftToMetadataPerRoute) ProtoMessage()

func (*ThriftToMetadataPerRoute) ProtoReflect

func (x *ThriftToMetadataPerRoute) ProtoReflect() protoreflect.Message

func (*ThriftToMetadataPerRoute) Reset

func (x *ThriftToMetadataPerRoute) Reset()

func (*ThriftToMetadataPerRoute) SetRequestRules

func (x *ThriftToMetadataPerRoute) SetRequestRules(v []*Rule)

func (*ThriftToMetadataPerRoute) SetResponseRules

func (x *ThriftToMetadataPerRoute) SetResponseRules(v []*Rule)

func (*ThriftToMetadataPerRoute) String

func (x *ThriftToMetadataPerRoute) String() string

type ThriftToMetadataPerRoute_builder

type ThriftToMetadataPerRoute_builder struct {

	// The list of rules to apply to http request body to extract thrift metadata.
	RequestRules []*Rule
	// The list of rules to apply to http response body to extract thrift metadata.
	ResponseRules []*Rule
	// contains filtered or unexported fields
}

func (ThriftToMetadataPerRoute_builder) Build

type ThriftToMetadata_builder

type ThriftToMetadata_builder struct {

	// The list of rules to apply to http request body to extract thrift metadata.
	RequestRules []*Rule
	// The list of rules to apply to http response body to extract thrift metadata.
	ResponseRules []*Rule
	// Supplies the type of transport that the Thrift proxy should use. Defaults to
	// :ref:`AUTO_TRANSPORT<envoy_v3_api_enum_value_extensions.filters.network.thrift_proxy.v3.TransportType.AUTO_TRANSPORT>`.
	Transport v3.TransportType
	// Supplies the type of protocol that the Thrift proxy should use. Defaults to
	// :ref:`AUTO_PROTOCOL<envoy_v3_api_enum_value_extensions.filters.network.thrift_proxy.v3.ProtocolType.AUTO_PROTOCOL>`.
	// Note that :ref:`LAX_BINARY<envoy_v3_api_enum_value_extensions.filters.network.thrift_proxy.v3.ProtocolType.LAX_BINARY>`
	// is not distinguished by :ref:`AUTO_PROTOCOL<envoy_v3_api_enum_value_extensions.filters.network.thrift_proxy.v3.ProtocolType.AUTO_PROTOCOL>`,
	// which is the same with :ref:`thrift_proxy network filter <envoy_v3_api_msg_extensions.filters.network.thrift_proxy.v3.ThriftProxy>`.
	// Note that :ref:`TWITTER<envoy_v3_api_enum_value_extensions.filters.network.thrift_proxy.v3.ProtocolType.TWITTER>` is
	// not supported due to deprecation in envoy.
	Protocol v3.ProtocolType
	// Allowed content-type for thrift payload to filter metadata transformation.
	// Default to “{"application/x-thrift"}“.
	//
	// Set “allow_empty_content_type“ if empty/missing content-type header
	// is allowed.
	AllowContentTypes []string
	// Allowed empty content-type for thrift payload to filter metadata transformation.
	// Default to false.
	AllowEmptyContentType bool
	// contains filtered or unexported fields
}

func (ThriftToMetadata_builder) Build

Source Files

  • thrift_to_metadata.pb.go

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL