// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.36.10
// 	protoc        v6.33.2
// source: envoy/extensions/filters/http/lua/v3/lua.proto

package luav3

import (
	_ "github.com/cncf/xds/go/udpa/annotations"
	_ "github.com/envoyproxy/go-control-plane/envoy/annotations"
	v3 "github.com/envoyproxy/go-control-plane/envoy/config/core/v3"
	_ "github.com/envoyproxy/protoc-gen-validate/validate"
	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
	structpb "google.golang.org/protobuf/types/known/structpb"
	wrapperspb "google.golang.org/protobuf/types/known/wrapperspb"
	reflect "reflect"
	sync "sync"
	unsafe "unsafe"
)

const (
	// Verify that this generated code is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
	// Verify that runtime/protoimpl is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)

// [#next-free-field: 6]
type Lua struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// The Lua code that Envoy will execute. This can be a very small script that
	// further loads code from disk if desired. Note that if JSON configuration is used, the code must
	// be properly escaped. YAML configuration may be easier to read since YAML supports multi-line
	// strings so complex scripts can be easily expressed inline in the configuration.
	//
	// This field is deprecated. Please use
	// :ref:`default_source_code <envoy_v3_api_field_extensions.filters.http.lua.v3.Lua.default_source_code>`.
	// Only one of :ref:`inline_code <envoy_v3_api_field_extensions.filters.http.lua.v3.Lua.inline_code>`
	// or :ref:`default_source_code <envoy_v3_api_field_extensions.filters.http.lua.v3.Lua.default_source_code>`
	// can be set for the Lua filter.
	//
	// Deprecated: Marked as deprecated in envoy/extensions/filters/http/lua/v3/lua.proto.
	InlineCode string `protobuf:"bytes,1,opt,name=inline_code,json=inlineCode,proto3" json:"inline_code,omitempty"`
	// Map of named Lua source codes that can be referenced in :ref:`LuaPerRoute
	// <envoy_v3_api_msg_extensions.filters.http.lua.v3.LuaPerRoute>`. The Lua source codes can be
	// loaded from inline string or local files.
	//
	// Example:
	//
	// .. code-block:: yaml
	//
	//	source_codes:
	//	  hello.lua:
	//	    inline_string: |
	//	      function envoy_on_response(response_handle)
	//	        -- Do something.
	//	      end
	//	  world.lua:
	//	    filename: /etc/lua/world.lua
	SourceCodes map[string]*v3.DataSource `protobuf:"bytes,2,rep,name=source_codes,json=sourceCodes,proto3" json:"source_codes,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
	// The default Lua code that Envoy will execute. If no per route config is provided
	// for the request, this Lua code will be applied.
	DefaultSourceCode *v3.DataSource `protobuf:"bytes,3,opt,name=default_source_code,json=defaultSourceCode,proto3" json:"default_source_code,omitempty"`
	// Optional additional prefix to use when emitting statistics. By default
	// metrics are emitted in *.lua.* namespace. If multiple lua filters are
	// configured in a filter chain, the stats from each filter instance can
	// be emitted using custom stat prefix to distinguish emitted
	// statistics. For example:
	//
	// .. code-block:: yaml
	//
	//	http_filters:
	//	  - name: envoy.filters.http.lua
	//	    typed_config:
	//	      "@type": type.googleapis.com/envoy.extensions.filters.http.lua.v3.Lua
	//	      stat_prefix: foo_script # This emits lua.foo_script.errors etc.
	//	  - name: envoy.filters.http.lua
	//	    typed_config:
	//	      "@type": type.googleapis.com/envoy.extensions.filters.http.lua.v3.Lua
	//	      stat_prefix: bar_script # This emits lua.bar_script.errors etc.
	StatPrefix string `protobuf:"bytes,4,opt,name=stat_prefix,json=statPrefix,proto3" json:"stat_prefix,omitempty"`
	// If set to true, the Lua filter will clear the route cache automatically if the request
	// headers are modified by the Lua script. If set to false, the Lua filter will not clear the
	// route cache automatically.
	// Default is true for backward compatibility.
	ClearRouteCache *wrapperspb.BoolValue `protobuf:"bytes,5,opt,name=clear_route_cache,json=clearRouteCache,proto3" json:"clear_route_cache,omitempty"`
	unknownFields   protoimpl.UnknownFields
	sizeCache       protoimpl.SizeCache
}

func (x *Lua) Reset() {
	*x = Lua{}
	mi := &file_envoy_extensions_filters_http_lua_v3_lua_proto_msgTypes[0]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *Lua) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*Lua) ProtoMessage() {}

func (x *Lua) ProtoReflect() protoreflect.Message {
	mi := &file_envoy_extensions_filters_http_lua_v3_lua_proto_msgTypes[0]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use Lua.ProtoReflect.Descriptor instead.
func (*Lua) Descriptor() ([]byte, []int) {
	return file_envoy_extensions_filters_http_lua_v3_lua_proto_rawDescGZIP(), []int{0}
}

// Deprecated: Marked as deprecated in envoy/extensions/filters/http/lua/v3/lua.proto.
func (x *Lua) GetInlineCode() string {
	if x != nil {
		return x.InlineCode
	}
	return ""
}

func (x *Lua) GetSourceCodes() map[string]*v3.DataSource {
	if x != nil {
		return x.SourceCodes
	}
	return nil
}

func (x *Lua) GetDefaultSourceCode() *v3.DataSource {
	if x != nil {
		return x.DefaultSourceCode
	}
	return nil
}

func (x *Lua) GetStatPrefix() string {
	if x != nil {
		return x.StatPrefix
	}
	return ""
}

func (x *Lua) GetClearRouteCache() *wrapperspb.BoolValue {
	if x != nil {
		return x.ClearRouteCache
	}
	return nil
}

type LuaPerRoute struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// Types that are valid to be assigned to Override:
	//
	//	*LuaPerRoute_Disabled
	//	*LuaPerRoute_Name
	//	*LuaPerRoute_SourceCode
	Override isLuaPerRoute_Override `protobuf_oneof:"override"`
	// Optional filter context for Lua script. This could be used to pass configuration
	// to Lua script. The Lua script can access the filter context using “handle:filterContext()“.
	// For example:
	//
	// .. code-block:: lua
	//
	//	function envoy_on_request(request_handle)
	//	  local filter_context = request_handle:filterContext()
	//	  local filter_context_value = filter_context["key"]
	//	  -- Do something with filter_context_value.
	//	end
	FilterContext *structpb.Struct `protobuf:"bytes,4,opt,name=filter_context,json=filterContext,proto3" json:"filter_context,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *LuaPerRoute) Reset() {
	*x = LuaPerRoute{}
	mi := &file_envoy_extensions_filters_http_lua_v3_lua_proto_msgTypes[1]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *LuaPerRoute) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*LuaPerRoute) ProtoMessage() {}

func (x *LuaPerRoute) ProtoReflect() protoreflect.Message {
	mi := &file_envoy_extensions_filters_http_lua_v3_lua_proto_msgTypes[1]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use LuaPerRoute.ProtoReflect.Descriptor instead.
func (*LuaPerRoute) Descriptor() ([]byte, []int) {
	return file_envoy_extensions_filters_http_lua_v3_lua_proto_rawDescGZIP(), []int{1}
}

func (x *LuaPerRoute) GetOverride() isLuaPerRoute_Override {
	if x != nil {
		return x.Override
	}
	return nil
}

func (x *LuaPerRoute) GetDisabled() bool {
	if x != nil {
		if x, ok := x.Override.(*LuaPerRoute_Disabled); ok {
			return x.Disabled
		}
	}
	return false
}

func (x *LuaPerRoute) GetName() string {
	if x != nil {
		if x, ok := x.Override.(*LuaPerRoute_Name); ok {
			return x.Name
		}
	}
	return ""
}

func (x *LuaPerRoute) GetSourceCode() *v3.DataSource {
	if x != nil {
		if x, ok := x.Override.(*LuaPerRoute_SourceCode); ok {
			return x.SourceCode
		}
	}
	return nil
}

func (x *LuaPerRoute) GetFilterContext() *structpb.Struct {
	if x != nil {
		return x.FilterContext
	}
	return nil
}

type isLuaPerRoute_Override interface {
	isLuaPerRoute_Override()
}

type LuaPerRoute_Disabled struct {
	// Disable the Lua filter for this particular vhost or route. If disabled is specified in
	// multiple per-filter-configs, the most specific one will be used.
	Disabled bool `protobuf:"varint,1,opt,name=disabled,proto3,oneof"`
}

type LuaPerRoute_Name struct {
	// A name of a Lua source code stored in
	// :ref:`Lua.source_codes <envoy_v3_api_field_extensions.filters.http.lua.v3.Lua.source_codes>`.
	Name string `protobuf:"bytes,2,opt,name=name,proto3,oneof"`
}

type LuaPerRoute_SourceCode struct {
	// A configured per-route Lua source code that can be served by RDS or provided inline.
	SourceCode *v3.DataSource `protobuf:"bytes,3,opt,name=source_code,json=sourceCode,proto3,oneof"`
}

func (*LuaPerRoute_Disabled) isLuaPerRoute_Override() {}

func (*LuaPerRoute_Name) isLuaPerRoute_Override() {}

func (*LuaPerRoute_SourceCode) isLuaPerRoute_Override() {}

var File_envoy_extensions_filters_http_lua_v3_lua_proto protoreflect.FileDescriptor

const file_envoy_extensions_filters_http_lua_v3_lua_proto_rawDesc = "" +
	"\n" +
	".envoy/extensions/filters/http/lua/v3/lua.proto\x12$envoy.extensions.filters.http.lua.v3\x1a\x1fenvoy/config/core/v3/base.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1egoogle/protobuf/wrappers.proto\x1a#envoy/annotations/deprecation.proto\x1a\x1dudpa/annotations/status.proto\x1a!udpa/annotations/versioning.proto\x1a\x17validate/validate.proto\"\xdb\x03\n" +
	"\x03Lua\x12,\n" +
	"\vinline_code\x18\x01 \x01(\tB\v\x92ǆ\xd8\x04\x033.0\x18\x01R\n" +
	"inlineCode\x12]\n" +
	"\fsource_codes\x18\x02 \x03(\v2:.envoy.extensions.filters.http.lua.v3.Lua.SourceCodesEntryR\vsourceCodes\x12P\n" +
	"\x13default_source_code\x18\x03 \x01(\v2 .envoy.config.core.v3.DataSourceR\x11defaultSourceCode\x12\x1f\n" +
	"\vstat_prefix\x18\x04 \x01(\tR\n" +
	"statPrefix\x12F\n" +
	"\x11clear_route_cache\x18\x05 \x01(\v2\x1a.google.protobuf.BoolValueR\x0fclearRouteCache\x1a`\n" +
	"\x10SourceCodesEntry\x12\x10\n" +
	"\x03key\x18\x01 \x01(\tR\x03key\x126\n" +
	"\x05value\x18\x02 \x01(\v2 .envoy.config.core.v3.DataSourceR\x05value:\x028\x01:*\x9aň\x1e%\n" +
	"#envoy.config.filter.http.lua.v2.Lua\"\xe4\x01\n" +
	"\vLuaPerRoute\x12%\n" +
	"\bdisabled\x18\x01 \x01(\bB\a\xfaB\x04j\x02\b\x01H\x00R\bdisabled\x12\x1d\n" +
	"\x04name\x18\x02 \x01(\tB\a\xfaB\x04r\x02\x10\x01H\x00R\x04name\x12C\n" +
	"\vsource_code\x18\x03 \x01(\v2 .envoy.config.core.v3.DataSourceH\x00R\n" +
	"sourceCode\x12>\n" +
	"\x0efilter_context\x18\x04 \x01(\v2\x17.google.protobuf.StructR\rfilterContextB\n" +
	"\n" +
	"\boverrideB\x9b\x01\xba\x80\xc8\xd1\x06\x02\x10\x02\n" +
	"2io.envoyproxy.envoy.extensions.filters.http.lua.v3B\bLuaProtoP\x01ZQgithub.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/lua/v3;luav3b\x06proto3"

var (
	file_envoy_extensions_filters_http_lua_v3_lua_proto_rawDescOnce sync.Once
	file_envoy_extensions_filters_http_lua_v3_lua_proto_rawDescData []byte
)

func file_envoy_extensions_filters_http_lua_v3_lua_proto_rawDescGZIP() []byte {
	file_envoy_extensions_filters_http_lua_v3_lua_proto_rawDescOnce.Do(func() {
		file_envoy_extensions_filters_http_lua_v3_lua_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_envoy_extensions_filters_http_lua_v3_lua_proto_rawDesc), len(file_envoy_extensions_filters_http_lua_v3_lua_proto_rawDesc)))
	})
	return file_envoy_extensions_filters_http_lua_v3_lua_proto_rawDescData
}

var file_envoy_extensions_filters_http_lua_v3_lua_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_envoy_extensions_filters_http_lua_v3_lua_proto_goTypes = []any{
	(*Lua)(nil),                  // 0: envoy.extensions.filters.http.lua.v3.Lua
	(*LuaPerRoute)(nil),          // 1: envoy.extensions.filters.http.lua.v3.LuaPerRoute
	nil,                          // 2: envoy.extensions.filters.http.lua.v3.Lua.SourceCodesEntry
	(*v3.DataSource)(nil),        // 3: envoy.config.core.v3.DataSource
	(*wrapperspb.BoolValue)(nil), // 4: google.protobuf.BoolValue
	(*structpb.Struct)(nil),      // 5: google.protobuf.Struct
}
var file_envoy_extensions_filters_http_lua_v3_lua_proto_depIdxs = []int32{
	2, // 0: envoy.extensions.filters.http.lua.v3.Lua.source_codes:type_name -> envoy.extensions.filters.http.lua.v3.Lua.SourceCodesEntry
	3, // 1: envoy.extensions.filters.http.lua.v3.Lua.default_source_code:type_name -> envoy.config.core.v3.DataSource
	4, // 2: envoy.extensions.filters.http.lua.v3.Lua.clear_route_cache:type_name -> google.protobuf.BoolValue
	3, // 3: envoy.extensions.filters.http.lua.v3.LuaPerRoute.source_code:type_name -> envoy.config.core.v3.DataSource
	5, // 4: envoy.extensions.filters.http.lua.v3.LuaPerRoute.filter_context:type_name -> google.protobuf.Struct
	3, // 5: envoy.extensions.filters.http.lua.v3.Lua.SourceCodesEntry.value:type_name -> envoy.config.core.v3.DataSource
	6, // [6:6] is the sub-list for method output_type
	6, // [6:6] is the sub-list for method input_type
	6, // [6:6] is the sub-list for extension type_name
	6, // [6:6] is the sub-list for extension extendee
	0, // [0:6] is the sub-list for field type_name
}

func init() { file_envoy_extensions_filters_http_lua_v3_lua_proto_init() }
func file_envoy_extensions_filters_http_lua_v3_lua_proto_init() {
	if File_envoy_extensions_filters_http_lua_v3_lua_proto != nil {
		return
	}
	file_envoy_extensions_filters_http_lua_v3_lua_proto_msgTypes[1].OneofWrappers = []any{
		(*LuaPerRoute_Disabled)(nil),
		(*LuaPerRoute_Name)(nil),
		(*LuaPerRoute_SourceCode)(nil),
	}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_envoy_extensions_filters_http_lua_v3_lua_proto_rawDesc), len(file_envoy_extensions_filters_http_lua_v3_lua_proto_rawDesc)),
			NumEnums:      0,
			NumMessages:   3,
			NumExtensions: 0,
			NumServices:   0,
		},
		GoTypes:           file_envoy_extensions_filters_http_lua_v3_lua_proto_goTypes,
		DependencyIndexes: file_envoy_extensions_filters_http_lua_v3_lua_proto_depIdxs,
		MessageInfos:      file_envoy_extensions_filters_http_lua_v3_lua_proto_msgTypes,
	}.Build()
	File_envoy_extensions_filters_http_lua_v3_lua_proto = out.File
	file_envoy_extensions_filters_http_lua_v3_lua_proto_goTypes = nil
	file_envoy_extensions_filters_http_lua_v3_lua_proto_depIdxs = nil
}
