json_to_metadatav3

package
v1.36.11-2026011520535... 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

View Source
const JsonToMetadata_KeyValuePair_ValueType_not_set_case case_JsonToMetadata_KeyValuePair_ValueType = 0
View Source
const JsonToMetadata_KeyValuePair_Value_case case_JsonToMetadata_KeyValuePair_ValueType = 3
View Source
const JsonToMetadata_Selector_Key_case case_JsonToMetadata_Selector_Selector = 1
View Source
const JsonToMetadata_Selector_Selector_not_set_case case_JsonToMetadata_Selector_Selector = 0

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) ClearRequestRules

func (x *JsonToMetadata) ClearRequestRules()

func (*JsonToMetadata) ClearResponseRules

func (x *JsonToMetadata) ClearResponseRules()

func (*JsonToMetadata) GetRequestRules

func (x *JsonToMetadata) GetRequestRules() *JsonToMetadata_MatchRules

func (*JsonToMetadata) GetResponseRules

func (x *JsonToMetadata) GetResponseRules() *JsonToMetadata_MatchRules

func (*JsonToMetadata) HasRequestRules

func (x *JsonToMetadata) HasRequestRules() bool

func (*JsonToMetadata) HasResponseRules

func (x *JsonToMetadata) HasResponseRules() bool

func (*JsonToMetadata) ProtoMessage

func (*JsonToMetadata) ProtoMessage()

func (*JsonToMetadata) ProtoReflect

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

func (*JsonToMetadata) Reset

func (x *JsonToMetadata) Reset()

func (*JsonToMetadata) SetRequestRules

func (x *JsonToMetadata) SetRequestRules(v *JsonToMetadata_MatchRules)

func (*JsonToMetadata) SetResponseRules

func (x *JsonToMetadata) SetResponseRules(v *JsonToMetadata_MatchRules)

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 valid to be assigned 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) ClearValue

func (x *JsonToMetadata_KeyValuePair) ClearValue()

func (*JsonToMetadata_KeyValuePair) ClearValueType

func (x *JsonToMetadata_KeyValuePair) ClearValueType()

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 (x *JsonToMetadata_KeyValuePair) GetValueType() isJsonToMetadata_KeyValuePair_ValueType

func (*JsonToMetadata_KeyValuePair) HasValue

func (x *JsonToMetadata_KeyValuePair) HasValue() bool

func (*JsonToMetadata_KeyValuePair) HasValueType

func (x *JsonToMetadata_KeyValuePair) HasValueType() bool

func (*JsonToMetadata_KeyValuePair) ProtoMessage

func (*JsonToMetadata_KeyValuePair) ProtoMessage()

func (*JsonToMetadata_KeyValuePair) ProtoReflect

func (*JsonToMetadata_KeyValuePair) Reset

func (x *JsonToMetadata_KeyValuePair) Reset()

func (*JsonToMetadata_KeyValuePair) SetKey

func (x *JsonToMetadata_KeyValuePair) SetKey(v string)

func (*JsonToMetadata_KeyValuePair) SetMetadataNamespace

func (x *JsonToMetadata_KeyValuePair) SetMetadataNamespace(v string)

func (*JsonToMetadata_KeyValuePair) SetPreserveExistingMetadataValue

func (x *JsonToMetadata_KeyValuePair) SetPreserveExistingMetadataValue(v bool)

func (*JsonToMetadata_KeyValuePair) SetType

func (*JsonToMetadata_KeyValuePair) SetValue

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

func (*JsonToMetadata_KeyValuePair) String

func (x *JsonToMetadata_KeyValuePair) String() string

func (*JsonToMetadata_KeyValuePair) WhichValueType

func (x *JsonToMetadata_KeyValuePair) WhichValueType() case_JsonToMetadata_KeyValuePair_ValueType

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_KeyValuePair_builder

type JsonToMetadata_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
	// Fields of oneof ValueType:
	// 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
	// -- end of ValueType
	// The value's type — defaults to protobuf.Value.
	Type JsonToMetadata_ValueType
	// False if we want to overwrite the existing metadata value. Default to false.
	PreserveExistingMetadataValue bool
	// contains filtered or unexported fields
}

func (JsonToMetadata_KeyValuePair_builder) Build

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) ClearAllowContentTypesRegex

func (x *JsonToMetadata_MatchRules) ClearAllowContentTypesRegex()

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) HasAllowContentTypesRegex

func (x *JsonToMetadata_MatchRules) HasAllowContentTypesRegex() bool

func (*JsonToMetadata_MatchRules) ProtoMessage

func (*JsonToMetadata_MatchRules) ProtoMessage()

func (*JsonToMetadata_MatchRules) ProtoReflect

func (*JsonToMetadata_MatchRules) Reset

func (x *JsonToMetadata_MatchRules) Reset()

func (*JsonToMetadata_MatchRules) SetAllowContentTypes

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

func (*JsonToMetadata_MatchRules) SetAllowContentTypesRegex

func (x *JsonToMetadata_MatchRules) SetAllowContentTypesRegex(v *v3.RegexMatcher)

func (*JsonToMetadata_MatchRules) SetAllowEmptyContentType

func (x *JsonToMetadata_MatchRules) SetAllowEmptyContentType(v bool)

func (*JsonToMetadata_MatchRules) SetRules

func (*JsonToMetadata_MatchRules) String

func (x *JsonToMetadata_MatchRules) String() string

type JsonToMetadata_MatchRules_builder

type JsonToMetadata_MatchRules_builder struct {

	// The list of rules to apply.
	Rules []*JsonToMetadata_Rule
	// 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
	// Allowed empty content-type for json to metadata transformation.
	// Default to false.
	AllowEmptyContentType bool
	// Allowed content-type by regex match for json to metadata transformation.
	// This can be used in parallel with “allow_content_types“.
	AllowContentTypesRegex *v3.RegexMatcher
	// contains filtered or unexported fields
}

func (JsonToMetadata_MatchRules_builder) Build

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) ClearOnError

func (x *JsonToMetadata_Rule) ClearOnError()

func (*JsonToMetadata_Rule) ClearOnMissing

func (x *JsonToMetadata_Rule) ClearOnMissing()

func (*JsonToMetadata_Rule) ClearOnPresent

func (x *JsonToMetadata_Rule) ClearOnPresent()

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) HasOnError

func (x *JsonToMetadata_Rule) HasOnError() bool

func (*JsonToMetadata_Rule) HasOnMissing

func (x *JsonToMetadata_Rule) HasOnMissing() bool

func (*JsonToMetadata_Rule) HasOnPresent

func (x *JsonToMetadata_Rule) HasOnPresent() bool

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) SetOnError

func (*JsonToMetadata_Rule) SetOnMissing

func (*JsonToMetadata_Rule) SetOnPresent

func (*JsonToMetadata_Rule) SetSelectors

func (x *JsonToMetadata_Rule) SetSelectors(v []*JsonToMetadata_Selector)

func (*JsonToMetadata_Rule) String

func (x *JsonToMetadata_Rule) String() string

type JsonToMetadata_Rule_builder

type JsonToMetadata_Rule_builder 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
	// If the attribute is present, apply this metadata KeyValuePair.
	OnPresent *JsonToMetadata_KeyValuePair
	// If the attribute is missing, apply this metadata KeyValuePair.
	//
	// The value in the KeyValuePair must be set.
	OnMissing *JsonToMetadata_KeyValuePair
	// 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
	// contains filtered or unexported fields
}

func (JsonToMetadata_Rule_builder) Build

type JsonToMetadata_Selector

type JsonToMetadata_Selector struct {

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

func (*JsonToMetadata_Selector) ClearKey

func (x *JsonToMetadata_Selector) ClearKey()

func (*JsonToMetadata_Selector) ClearSelector

func (x *JsonToMetadata_Selector) ClearSelector()

func (*JsonToMetadata_Selector) GetKey

func (x *JsonToMetadata_Selector) GetKey() string

func (*JsonToMetadata_Selector) GetSelector

func (x *JsonToMetadata_Selector) GetSelector() isJsonToMetadata_Selector_Selector

func (*JsonToMetadata_Selector) HasKey

func (x *JsonToMetadata_Selector) HasKey() bool

func (*JsonToMetadata_Selector) HasSelector

func (x *JsonToMetadata_Selector) HasSelector() bool

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) SetKey

func (x *JsonToMetadata_Selector) SetKey(v string)

func (*JsonToMetadata_Selector) String

func (x *JsonToMetadata_Selector) String() string

func (*JsonToMetadata_Selector) WhichSelector

func (x *JsonToMetadata_Selector) WhichSelector() case_JsonToMetadata_Selector_Selector

type JsonToMetadata_Selector_Key

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

type JsonToMetadata_Selector_builder

type JsonToMetadata_Selector_builder struct {

	// Fields of oneof Selector:
	// key to match
	Key *string
	// contains filtered or unexported fields
}

func (JsonToMetadata_Selector_builder) Build

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) Number

func (JsonToMetadata_ValueType) String

func (x JsonToMetadata_ValueType) String() string

func (JsonToMetadata_ValueType) Type

type JsonToMetadata_builder

type JsonToMetadata_builder struct {

	// At least one of request_rules and response_rules must be provided.
	// Rules to match json body of requests.
	RequestRules *JsonToMetadata_MatchRules
	// Rules to match json body of responses.
	ResponseRules *JsonToMetadata_MatchRules
	// contains filtered or unexported fields
}

func (JsonToMetadata_builder) Build

Source Files

  • json_to_metadata.pb.go

Jump to

Keyboard shortcuts

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