Documentation
¶
Index ¶
- Variables
- type Config
- func (x *Config) GetRequestRules() []*Config_Rule
- func (x *Config) GetResponseRules() []*Config_Rule
- func (x *Config) GetStatPrefix() string
- func (*Config) ProtoMessage()
- func (x *Config) ProtoReflect() protoreflect.Message
- func (x *Config) Reset()
- func (x *Config) SetRequestRules(v []*Config_Rule)
- func (x *Config) SetResponseRules(v []*Config_Rule)
- func (x *Config) SetStatPrefix(v string)
- func (x *Config) String() string
- type Config_KeyValuePair
- func (x *Config_KeyValuePair) ClearRegexValueRewrite()
- func (x *Config_KeyValuePair) GetEncode() Config_ValueEncode
- func (x *Config_KeyValuePair) GetKey() string
- func (x *Config_KeyValuePair) GetMetadataNamespace() string
- func (x *Config_KeyValuePair) GetRegexValueRewrite() *v3.RegexMatchAndSubstitute
- func (x *Config_KeyValuePair) GetType() Config_ValueType
- func (x *Config_KeyValuePair) GetValue() string
- func (x *Config_KeyValuePair) HasRegexValueRewrite() bool
- func (*Config_KeyValuePair) ProtoMessage()
- func (x *Config_KeyValuePair) ProtoReflect() protoreflect.Message
- func (x *Config_KeyValuePair) Reset()
- func (x *Config_KeyValuePair) SetEncode(v Config_ValueEncode)
- func (x *Config_KeyValuePair) SetKey(v string)
- func (x *Config_KeyValuePair) SetMetadataNamespace(v string)
- func (x *Config_KeyValuePair) SetRegexValueRewrite(v *v3.RegexMatchAndSubstitute)
- func (x *Config_KeyValuePair) SetType(v Config_ValueType)
- func (x *Config_KeyValuePair) SetValue(v string)
- func (x *Config_KeyValuePair) String() string
- type Config_KeyValuePair_builder
- type Config_Rule
- func (x *Config_Rule) ClearOnHeaderMissing()
- func (x *Config_Rule) ClearOnHeaderPresent()
- func (x *Config_Rule) GetCookie() string
- func (x *Config_Rule) GetHeader() string
- func (x *Config_Rule) GetOnHeaderMissing() *Config_KeyValuePair
- func (x *Config_Rule) GetOnHeaderPresent() *Config_KeyValuePair
- func (x *Config_Rule) GetRemove() bool
- func (x *Config_Rule) HasOnHeaderMissing() bool
- func (x *Config_Rule) HasOnHeaderPresent() bool
- func (*Config_Rule) ProtoMessage()
- func (x *Config_Rule) ProtoReflect() protoreflect.Message
- func (x *Config_Rule) Reset()
- func (x *Config_Rule) SetCookie(v string)
- func (x *Config_Rule) SetHeader(v string)
- func (x *Config_Rule) SetOnHeaderMissing(v *Config_KeyValuePair)
- func (x *Config_Rule) SetOnHeaderPresent(v *Config_KeyValuePair)
- func (x *Config_Rule) SetRemove(v bool)
- func (x *Config_Rule) String() string
- type Config_Rule_builder
- type Config_ValueEncode
- type Config_ValueType
- type Config_builder
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Config_ValueType_name = map[int32]string{ 0: "STRING", 1: "NUMBER", 2: "PROTOBUF_VALUE", } Config_ValueType_value = map[string]int32{ "STRING": 0, "NUMBER": 1, "PROTOBUF_VALUE": 2, } )
Enum value maps for Config_ValueType.
View Source
var ( Config_ValueEncode_name = map[int32]string{ 0: "NONE", 1: "BASE64", } Config_ValueEncode_value = map[string]int32{ "NONE": 0, "BASE64": 1, } )
Enum value maps for Config_ValueEncode.
View Source
var File_envoy_extensions_filters_http_header_to_metadata_v3_header_to_metadata_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// The list of rules to apply to requests.
RequestRules []*Config_Rule `protobuf:"bytes,1,rep,name=request_rules,json=requestRules,proto3" json:"request_rules,omitempty"`
// The list of rules to apply to responses.
ResponseRules []*Config_Rule `protobuf:"bytes,2,rep,name=response_rules,json=responseRules,proto3" json:"response_rules,omitempty"`
// Optional prefix to use when emitting filter statistics. When configured,
// statistics are emitted with the prefix “http_filter_name.<stat_prefix>“.
//
// This emits statistics such as:
//
// - “http_filter_name.my_header_converter.rules_processed“
// - “http_filter_name.my_header_converter.metadata_added“
//
// If not configured, no statistics are emitted.
StatPrefix string `protobuf:"bytes,3,opt,name=stat_prefix,json=statPrefix,proto3" json:"stat_prefix,omitempty"`
// contains filtered or unexported fields
}
func (*Config) GetRequestRules ¶
func (x *Config) GetRequestRules() []*Config_Rule
func (*Config) GetResponseRules ¶
func (x *Config) GetResponseRules() []*Config_Rule
func (*Config) ProtoReflect ¶
func (x *Config) ProtoReflect() protoreflect.Message
func (*Config) SetRequestRules ¶
func (x *Config) SetRequestRules(v []*Config_Rule)
func (*Config) SetResponseRules ¶
func (x *Config) SetResponseRules(v []*Config_Rule)
type Config_KeyValuePair ¶
type Config_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"`
// The value to pair with the given key.
//
// When used for a
// :ref:`on_header_present <envoy_v3_api_field_extensions.filters.http.header_to_metadata.v3.Config.Rule.on_header_present>`
// case, if value is non-empty it'll be used instead of the header value. If both are empty, no metadata is added.
//
// When used for a :ref:`on_header_missing <envoy_v3_api_field_extensions.filters.http.header_to_metadata.v3.Config.Rule.on_header_missing>`
// case, a non-empty value must be provided otherwise no metadata is added.
Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"`
// If present, the header's value will be matched and substituted with this. If there is no match or substitution, the header value
// is used as-is.
//
// This is only used for :ref:`on_header_present <envoy_v3_api_field_extensions.filters.http.header_to_metadata.v3.Config.Rule.on_header_present>`.
//
// .. note::
//
// If the “value“ field is non-empty this field should be empty.
RegexValueRewrite *v3.RegexMatchAndSubstitute `protobuf:"bytes,6,opt,name=regex_value_rewrite,json=regexValueRewrite,proto3" json:"regex_value_rewrite,omitempty"`
// The value's type — defaults to string.
Type Config_ValueType `` /* 136-byte string literal not displayed */
// How is the value encoded, default is NONE (not encoded).
// The value will be decoded accordingly before storing to metadata.
Encode Config_ValueEncode `` /* 142-byte string literal not displayed */
// contains filtered or unexported fields
}
[#next-free-field: 7]
func (*Config_KeyValuePair) ClearRegexValueRewrite ¶
func (x *Config_KeyValuePair) ClearRegexValueRewrite()
func (*Config_KeyValuePair) GetEncode ¶
func (x *Config_KeyValuePair) GetEncode() Config_ValueEncode
func (*Config_KeyValuePair) GetKey ¶
func (x *Config_KeyValuePair) GetKey() string
func (*Config_KeyValuePair) GetMetadataNamespace ¶
func (x *Config_KeyValuePair) GetMetadataNamespace() string
func (*Config_KeyValuePair) GetRegexValueRewrite ¶
func (x *Config_KeyValuePair) GetRegexValueRewrite() *v3.RegexMatchAndSubstitute
func (*Config_KeyValuePair) GetType ¶
func (x *Config_KeyValuePair) GetType() Config_ValueType
func (*Config_KeyValuePair) GetValue ¶
func (x *Config_KeyValuePair) GetValue() string
func (*Config_KeyValuePair) HasRegexValueRewrite ¶
func (x *Config_KeyValuePair) HasRegexValueRewrite() bool
func (*Config_KeyValuePair) ProtoMessage ¶
func (*Config_KeyValuePair) ProtoMessage()
func (*Config_KeyValuePair) ProtoReflect ¶
func (x *Config_KeyValuePair) ProtoReflect() protoreflect.Message
func (*Config_KeyValuePair) Reset ¶
func (x *Config_KeyValuePair) Reset()
func (*Config_KeyValuePair) SetEncode ¶
func (x *Config_KeyValuePair) SetEncode(v Config_ValueEncode)
func (*Config_KeyValuePair) SetKey ¶
func (x *Config_KeyValuePair) SetKey(v string)
func (*Config_KeyValuePair) SetMetadataNamespace ¶
func (x *Config_KeyValuePair) SetMetadataNamespace(v string)
func (*Config_KeyValuePair) SetRegexValueRewrite ¶
func (x *Config_KeyValuePair) SetRegexValueRewrite(v *v3.RegexMatchAndSubstitute)
func (*Config_KeyValuePair) SetType ¶
func (x *Config_KeyValuePair) SetType(v Config_ValueType)
func (*Config_KeyValuePair) SetValue ¶
func (x *Config_KeyValuePair) SetValue(v string)
func (*Config_KeyValuePair) String ¶
func (x *Config_KeyValuePair) String() string
type Config_KeyValuePair_builder ¶
type Config_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
// The value to pair with the given key.
//
// When used for a
// :ref:`on_header_present <envoy_v3_api_field_extensions.filters.http.header_to_metadata.v3.Config.Rule.on_header_present>`
// case, if value is non-empty it'll be used instead of the header value. If both are empty, no metadata is added.
//
// When used for a :ref:`on_header_missing <envoy_v3_api_field_extensions.filters.http.header_to_metadata.v3.Config.Rule.on_header_missing>`
// case, a non-empty value must be provided otherwise no metadata is added.
Value string
// If present, the header's value will be matched and substituted with this. If there is no match or substitution, the header value
// is used as-is.
//
// This is only used for :ref:`on_header_present <envoy_v3_api_field_extensions.filters.http.header_to_metadata.v3.Config.Rule.on_header_present>`.
//
// .. note::
//
// If the “value“ field is non-empty this field should be empty.
RegexValueRewrite *v3.RegexMatchAndSubstitute
// The value's type — defaults to string.
Type Config_ValueType
// How is the value encoded, default is NONE (not encoded).
// The value will be decoded accordingly before storing to metadata.
Encode Config_ValueEncode
// contains filtered or unexported fields
}
func (Config_KeyValuePair_builder) Build ¶
func (b0 Config_KeyValuePair_builder) Build() *Config_KeyValuePair
type Config_Rule ¶
type Config_Rule struct {
// Specifies that a match will be performed on the value of a header or a cookie.
//
// The header to be extracted.
Header string `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"`
// The cookie to be extracted.
Cookie string `protobuf:"bytes,5,opt,name=cookie,proto3" json:"cookie,omitempty"`
// If the header or cookie is present, apply this metadata “KeyValuePair“.
//
// If the value in the “KeyValuePair“ is non-empty, it'll be used instead
// of the header or cookie value.
OnHeaderPresent *Config_KeyValuePair `protobuf:"bytes,2,opt,name=on_header_present,json=onHeaderPresent,proto3" json:"on_header_present,omitempty"`
// If the header or cookie is not present, apply this metadata “KeyValuePair“.
//
// The value in the “KeyValuePair“ must be set, since it'll be used in lieu
// of the missing header or cookie value.
OnHeaderMissing *Config_KeyValuePair `protobuf:"bytes,3,opt,name=on_header_missing,json=onHeaderMissing,proto3" json:"on_header_missing,omitempty"`
// Whether or not to remove the header after a rule is applied.
//
// This prevents headers from leaking.
// This field is not supported in case of a cookie.
Remove bool `protobuf:"varint,4,opt,name=remove,proto3" json:"remove,omitempty"`
// contains filtered or unexported fields
}
A Rule defines what metadata to apply when a header is present or missing. [#next-free-field: 6]
func (*Config_Rule) ClearOnHeaderMissing ¶
func (x *Config_Rule) ClearOnHeaderMissing()
func (*Config_Rule) ClearOnHeaderPresent ¶
func (x *Config_Rule) ClearOnHeaderPresent()
func (*Config_Rule) GetCookie ¶
func (x *Config_Rule) GetCookie() string
func (*Config_Rule) GetHeader ¶
func (x *Config_Rule) GetHeader() string
func (*Config_Rule) GetOnHeaderMissing ¶
func (x *Config_Rule) GetOnHeaderMissing() *Config_KeyValuePair
func (*Config_Rule) GetOnHeaderPresent ¶
func (x *Config_Rule) GetOnHeaderPresent() *Config_KeyValuePair
func (*Config_Rule) GetRemove ¶
func (x *Config_Rule) GetRemove() bool
func (*Config_Rule) HasOnHeaderMissing ¶
func (x *Config_Rule) HasOnHeaderMissing() bool
func (*Config_Rule) HasOnHeaderPresent ¶
func (x *Config_Rule) HasOnHeaderPresent() bool
func (*Config_Rule) ProtoMessage ¶
func (*Config_Rule) ProtoMessage()
func (*Config_Rule) ProtoReflect ¶
func (x *Config_Rule) ProtoReflect() protoreflect.Message
func (*Config_Rule) Reset ¶
func (x *Config_Rule) Reset()
func (*Config_Rule) SetCookie ¶
func (x *Config_Rule) SetCookie(v string)
func (*Config_Rule) SetHeader ¶
func (x *Config_Rule) SetHeader(v string)
func (*Config_Rule) SetOnHeaderMissing ¶
func (x *Config_Rule) SetOnHeaderMissing(v *Config_KeyValuePair)
func (*Config_Rule) SetOnHeaderPresent ¶
func (x *Config_Rule) SetOnHeaderPresent(v *Config_KeyValuePair)
func (*Config_Rule) SetRemove ¶
func (x *Config_Rule) SetRemove(v bool)
func (*Config_Rule) String ¶
func (x *Config_Rule) String() string
type Config_Rule_builder ¶
type Config_Rule_builder struct {
// Specifies that a match will be performed on the value of a header or a cookie.
//
// The header to be extracted.
Header string
// The cookie to be extracted.
Cookie string
// If the header or cookie is present, apply this metadata “KeyValuePair“.
//
// If the value in the “KeyValuePair“ is non-empty, it'll be used instead
// of the header or cookie value.
OnHeaderPresent *Config_KeyValuePair
// If the header or cookie is not present, apply this metadata “KeyValuePair“.
//
// The value in the “KeyValuePair“ must be set, since it'll be used in lieu
// of the missing header or cookie value.
OnHeaderMissing *Config_KeyValuePair
// Whether or not to remove the header after a rule is applied.
//
// This prevents headers from leaking.
// This field is not supported in case of a cookie.
Remove bool
// contains filtered or unexported fields
}
func (Config_Rule_builder) Build ¶
func (b0 Config_Rule_builder) Build() *Config_Rule
type Config_ValueEncode ¶
type Config_ValueEncode int32
Specifies the encoding scheme for the value.
const ( // No encoding is applied. Config_NONE Config_ValueEncode = 0 // The value is encoded in `Base64 <https://tools.ietf.org/html/rfc4648#section-4>`_. // // .. note:: // // This is mostly used for “STRING“ and “PROTOBUF_VALUE“ to escape the // non-ASCII characters in the header. Config_BASE64 Config_ValueEncode = 1 )
func (Config_ValueEncode) Descriptor ¶
func (Config_ValueEncode) Descriptor() protoreflect.EnumDescriptor
func (Config_ValueEncode) Enum ¶
func (x Config_ValueEncode) Enum() *Config_ValueEncode
func (Config_ValueEncode) Number ¶
func (x Config_ValueEncode) Number() protoreflect.EnumNumber
func (Config_ValueEncode) String ¶
func (x Config_ValueEncode) String() string
func (Config_ValueEncode) Type ¶
func (Config_ValueEncode) Type() protoreflect.EnumType
type Config_ValueType ¶
type Config_ValueType int32
Specifies the value type to use in metadata.
const ( Config_STRING Config_ValueType = 0 Config_NUMBER Config_ValueType = 1 // The value is a serialized `protobuf.Value // <https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto#L62>`_. Config_PROTOBUF_VALUE Config_ValueType = 2 )
func (Config_ValueType) Descriptor ¶
func (Config_ValueType) Descriptor() protoreflect.EnumDescriptor
func (Config_ValueType) Enum ¶
func (x Config_ValueType) Enum() *Config_ValueType
func (Config_ValueType) Number ¶
func (x Config_ValueType) Number() protoreflect.EnumNumber
func (Config_ValueType) String ¶
func (x Config_ValueType) String() string
func (Config_ValueType) Type ¶
func (Config_ValueType) Type() protoreflect.EnumType
type Config_builder ¶
type Config_builder struct {
// The list of rules to apply to requests.
RequestRules []*Config_Rule
// The list of rules to apply to responses.
ResponseRules []*Config_Rule
// Optional prefix to use when emitting filter statistics. When configured,
// statistics are emitted with the prefix “http_filter_name.<stat_prefix>“.
//
// This emits statistics such as:
//
// - “http_filter_name.my_header_converter.rules_processed“
// - “http_filter_name.my_header_converter.metadata_added“
//
// If not configured, no statistics are emitted.
StatPrefix string
// contains filtered or unexported fields
}
func (Config_builder) Build ¶
func (b0 Config_builder) Build() *Config
Source Files
¶
- header_to_metadata.pb.go
Click to show internal directories.
Click to hide internal directories.