json_to_metadatav3

package
v1.33.0-20240426201503... Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	JsonToMetadata_ValueType_name = map[int32]string{
		0: "PROTOBUF_VALUE",
		1: "STRING",
		2: "NUMBER",
	}
	JsonToMetadata_ValueType_value = map[string]int32{
		"PROTOBUF_VALUE": 0,
		"STRING":         1,
		"NUMBER":         2,
	}
)

Enum value maps for JsonToMetadata_ValueType.

View Source
var File_envoy_extensions_filters_http_json_to_metadata_v3_json_to_metadata_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type JsonToMetadata

type JsonToMetadata struct {

	// At least one of request_rules and response_rules must be provided.
	// Rules to match json body of requests.
	RequestRules *JsonToMetadata_MatchRules `protobuf:"bytes,1,opt,name=request_rules,json=requestRules,proto3" json:"request_rules,omitempty"`
	// Rules to match json body of responses.
	ResponseRules *JsonToMetadata_MatchRules `protobuf:"bytes,2,opt,name=response_rules,json=responseRules,proto3" json:"response_rules,omitempty"`
	// contains filtered or unexported fields
}

func (*JsonToMetadata) Descriptor deprecated

func (*JsonToMetadata) Descriptor() ([]byte, []int)

Deprecated: Use JsonToMetadata.ProtoReflect.Descriptor instead.

func (*JsonToMetadata) GetRequestRules

func (x *JsonToMetadata) GetRequestRules() *JsonToMetadata_MatchRules

func (*JsonToMetadata) GetResponseRules

func (x *JsonToMetadata) GetResponseRules() *JsonToMetadata_MatchRules

func (*JsonToMetadata) ProtoMessage

func (*JsonToMetadata) ProtoMessage()

func (*JsonToMetadata) ProtoReflect

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

func (*JsonToMetadata) Reset

func (x *JsonToMetadata) Reset()

func (*JsonToMetadata) String

func (x *JsonToMetadata) String() string

type JsonToMetadata_KeyValuePair

type JsonToMetadata_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"`
	// Types that are assignable to ValueType:
	//
	//	*JsonToMetadata_KeyValuePair_Value
	ValueType isJsonToMetadata_KeyValuePair_ValueType `protobuf_oneof:"value_type"`
	// The value's type — defaults to protobuf.Value.
	Type JsonToMetadata_ValueType `` /* 142-byte string literal not displayed */
	// False if we want to overwrite the existing metadata value. Default to false.
	PreserveExistingMetadataValue bool `` /* 153-byte string literal not displayed */
	// contains filtered or unexported fields
}

[#next-free-field: 6]

func (*JsonToMetadata_KeyValuePair) Descriptor deprecated

func (*JsonToMetadata_KeyValuePair) Descriptor() ([]byte, []int)

Deprecated: Use JsonToMetadata_KeyValuePair.ProtoReflect.Descriptor instead.

func (*JsonToMetadata_KeyValuePair) GetKey

func (x *JsonToMetadata_KeyValuePair) GetKey() string

func (*JsonToMetadata_KeyValuePair) GetMetadataNamespace

func (x *JsonToMetadata_KeyValuePair) GetMetadataNamespace() string

func (*JsonToMetadata_KeyValuePair) GetPreserveExistingMetadataValue

func (x *JsonToMetadata_KeyValuePair) GetPreserveExistingMetadataValue() bool

func (*JsonToMetadata_KeyValuePair) GetType

func (*JsonToMetadata_KeyValuePair) GetValue

func (*JsonToMetadata_KeyValuePair) GetValueType

func (m *JsonToMetadata_KeyValuePair) GetValueType() isJsonToMetadata_KeyValuePair_ValueType

func (*JsonToMetadata_KeyValuePair) ProtoMessage

func (*JsonToMetadata_KeyValuePair) ProtoMessage()

func (*JsonToMetadata_KeyValuePair) ProtoReflect

func (*JsonToMetadata_KeyValuePair) Reset

func (x *JsonToMetadata_KeyValuePair) Reset()

func (*JsonToMetadata_KeyValuePair) String

func (x *JsonToMetadata_KeyValuePair) String() string

type JsonToMetadata_KeyValuePair_Value

type JsonToMetadata_KeyValuePair_Value struct {
	// The value to pair with the given key.
	//
	// When used for on_present case, if value is non-empty it'll be used instead
	// of the the value of the JSON key. If both are empty, the the value of the
	// JSON key is used as-is.
	//
	// When used for on_missing/on_error case, a non-empty value
	// must be provided.
	//
	// It ignores ValueType, i.e., not type casting.
	Value *structpb.Value `protobuf:"bytes,3,opt,name=value,proto3,oneof"`
}

type JsonToMetadata_MatchRules

type JsonToMetadata_MatchRules struct {

	// The list of rules to apply.
	Rules []*JsonToMetadata_Rule `protobuf:"bytes,1,rep,name=rules,proto3" json:"rules,omitempty"`
	// Allowed content-type for json to metadata transformation.
	// Default to “{"application/json"}“.
	//
	// Set “allow_empty_content_type“ if empty/missing content-type header
	// is allowed.
	AllowContentTypes []string `protobuf:"bytes,2,rep,name=allow_content_types,json=allowContentTypes,proto3" json:"allow_content_types,omitempty"`
	// Allowed empty content-type for json to metadata transformation.
	// Default to false.
	AllowEmptyContentType bool `` /* 129-byte string literal not displayed */
	// Allowed content-type by regex match for json to metadata transformation.
	// This can be used in parallel with “allow_content_types“.
	AllowContentTypesRegex *v3.RegexMatcher `` /* 131-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*JsonToMetadata_MatchRules) Descriptor deprecated

func (*JsonToMetadata_MatchRules) Descriptor() ([]byte, []int)

Deprecated: Use JsonToMetadata_MatchRules.ProtoReflect.Descriptor instead.

func (*JsonToMetadata_MatchRules) GetAllowContentTypes

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

func (*JsonToMetadata_MatchRules) GetAllowContentTypesRegex

func (x *JsonToMetadata_MatchRules) GetAllowContentTypesRegex() *v3.RegexMatcher

func (*JsonToMetadata_MatchRules) GetAllowEmptyContentType

func (x *JsonToMetadata_MatchRules) GetAllowEmptyContentType() bool

func (*JsonToMetadata_MatchRules) GetRules

func (*JsonToMetadata_MatchRules) ProtoMessage

func (*JsonToMetadata_MatchRules) ProtoMessage()

func (*JsonToMetadata_MatchRules) ProtoReflect

func (*JsonToMetadata_MatchRules) Reset

func (x *JsonToMetadata_MatchRules) Reset()

func (*JsonToMetadata_MatchRules) String

func (x *JsonToMetadata_MatchRules) String() string

type JsonToMetadata_Rule

type JsonToMetadata_Rule struct {

	// Specifies that a match will be performed on the value of a property.
	// Here's an example to match on 1 in {"foo": {"bar": 1}, "bar": 2}
	//
	// selectors:
	// - key: foo
	// - key: bar
	Selectors []*JsonToMetadata_Selector `protobuf:"bytes,1,rep,name=selectors,proto3" json:"selectors,omitempty"`
	// If the attribute is present, apply this metadata KeyValuePair.
	OnPresent *JsonToMetadata_KeyValuePair `protobuf:"bytes,2,opt,name=on_present,json=onPresent,proto3" json:"on_present,omitempty"`
	// If the attribute is missing, apply this metadata KeyValuePair.
	//
	// The value in the KeyValuePair must be set.
	OnMissing *JsonToMetadata_KeyValuePair `protobuf:"bytes,3,opt,name=on_missing,json=onMissing,proto3" json:"on_missing,omitempty"`
	// If the body is too large or fail to parse or content-type is mismatched, apply this metadata KeyValuePair.
	//
	// The value in the KeyValuePair must be set.
	OnError *JsonToMetadata_KeyValuePair `protobuf:"bytes,4,opt,name=on_error,json=onError,proto3" json:"on_error,omitempty"`
	// contains filtered or unexported fields
}

A Rule defines what metadata to apply when a key-value is present, missing in the json or fail to parse the payload.

func (*JsonToMetadata_Rule) Descriptor deprecated

func (*JsonToMetadata_Rule) Descriptor() ([]byte, []int)

Deprecated: Use JsonToMetadata_Rule.ProtoReflect.Descriptor instead.

func (*JsonToMetadata_Rule) GetOnError

func (*JsonToMetadata_Rule) GetOnMissing

func (*JsonToMetadata_Rule) GetOnPresent

func (*JsonToMetadata_Rule) GetSelectors

func (x *JsonToMetadata_Rule) GetSelectors() []*JsonToMetadata_Selector

func (*JsonToMetadata_Rule) ProtoMessage

func (*JsonToMetadata_Rule) ProtoMessage()

func (*JsonToMetadata_Rule) ProtoReflect

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

func (*JsonToMetadata_Rule) Reset

func (x *JsonToMetadata_Rule) Reset()

func (*JsonToMetadata_Rule) String

func (x *JsonToMetadata_Rule) String() string

type JsonToMetadata_Selector

type JsonToMetadata_Selector struct {

	// Types that are assignable to Selector:
	//
	//	*JsonToMetadata_Selector_Key
	Selector isJsonToMetadata_Selector_Selector `protobuf_oneof:"selector"`
	// contains filtered or unexported fields
}

func (*JsonToMetadata_Selector) Descriptor deprecated

func (*JsonToMetadata_Selector) Descriptor() ([]byte, []int)

Deprecated: Use JsonToMetadata_Selector.ProtoReflect.Descriptor instead.

func (*JsonToMetadata_Selector) GetKey

func (x *JsonToMetadata_Selector) GetKey() string

func (*JsonToMetadata_Selector) GetSelector

func (m *JsonToMetadata_Selector) GetSelector() isJsonToMetadata_Selector_Selector

func (*JsonToMetadata_Selector) ProtoMessage

func (*JsonToMetadata_Selector) ProtoMessage()

func (*JsonToMetadata_Selector) ProtoReflect

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

func (*JsonToMetadata_Selector) Reset

func (x *JsonToMetadata_Selector) Reset()

func (*JsonToMetadata_Selector) String

func (x *JsonToMetadata_Selector) String() string

type JsonToMetadata_Selector_Key

type JsonToMetadata_Selector_Key struct {
	// key to match
	Key string `protobuf:"bytes,1,opt,name=key,proto3,oneof"`
}

type JsonToMetadata_ValueType

type JsonToMetadata_ValueType int32
const (
	// The value is a serialized `protobuf.Value
	// <https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto#L62>`_.
	JsonToMetadata_PROTOBUF_VALUE JsonToMetadata_ValueType = 0
	JsonToMetadata_STRING         JsonToMetadata_ValueType = 1
	JsonToMetadata_NUMBER         JsonToMetadata_ValueType = 2
)

func (JsonToMetadata_ValueType) Descriptor

func (JsonToMetadata_ValueType) Enum

func (JsonToMetadata_ValueType) EnumDescriptor deprecated

func (JsonToMetadata_ValueType) EnumDescriptor() ([]byte, []int)

Deprecated: Use JsonToMetadata_ValueType.Descriptor instead.

func (JsonToMetadata_ValueType) Number

func (JsonToMetadata_ValueType) String

func (x JsonToMetadata_ValueType) String() string

func (JsonToMetadata_ValueType) Type

Jump to

Keyboard shortcuts

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