// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.36.10
// 	protoc        v6.33.2
// source: contrib/envoy/extensions/filters/network/postgres_proxy/v3alpha/postgres_proxy.proto

package v3alpha

import (
	_ "github.com/cncf/xds/go/udpa/annotations"
	_ "github.com/envoyproxy/go-control-plane/envoy/annotations"
	_ "github.com/envoyproxy/protoc-gen-validate/validate"
	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
	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)
)

// Downstream and Upstream SSL operational modes.
type PostgresProxy_SSLMode int32

const (
	// If used in downstream ssl, do not terminate SSL session initiated by a client.
	// The Postgres proxy filter will pass all encrypted and unencrypted packets to the upstream server.
	// If used in upstream ssl, do not encrypt upstream connection to the server.
	PostgresProxy_DISABLE PostgresProxy_SSLMode = 0
	// If used in downstream ssl, the Postgres proxy filter will terminate SSL
	// session and close downstream connections that refuse to upgrade to SSL.
	// If used in upstream SSL, establish upstream SSL connection to the server. If the server does not
	// accept the request for SSL connection, the session is terminated.
	PostgresProxy_REQUIRE PostgresProxy_SSLMode = 1
	// If used in downstream SSL, the Postgres proxy filter will accept downstream
	// client's encryption settings. If the client wants to use clear-text,
	// Envoy will not enforce SSL encryption.
	// If the client wants to use encryption, Envoy will terminate SSL.
	PostgresProxy_ALLOW PostgresProxy_SSLMode = 2
)

// Enum value maps for PostgresProxy_SSLMode.
var (
	PostgresProxy_SSLMode_name = map[int32]string{
		0: "DISABLE",
		1: "REQUIRE",
		2: "ALLOW",
	}
	PostgresProxy_SSLMode_value = map[string]int32{
		"DISABLE": 0,
		"REQUIRE": 1,
		"ALLOW":   2,
	}
)

func (x PostgresProxy_SSLMode) Enum() *PostgresProxy_SSLMode {
	p := new(PostgresProxy_SSLMode)
	*p = x
	return p
}

func (x PostgresProxy_SSLMode) String() string {
	return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}

func (PostgresProxy_SSLMode) Descriptor() protoreflect.EnumDescriptor {
	return file_contrib_envoy_extensions_filters_network_postgres_proxy_v3alpha_postgres_proxy_proto_enumTypes[0].Descriptor()
}

func (PostgresProxy_SSLMode) Type() protoreflect.EnumType {
	return &file_contrib_envoy_extensions_filters_network_postgres_proxy_v3alpha_postgres_proxy_proto_enumTypes[0]
}

func (x PostgresProxy_SSLMode) Number() protoreflect.EnumNumber {
	return protoreflect.EnumNumber(x)
}

// Deprecated: Use PostgresProxy_SSLMode.Descriptor instead.
func (PostgresProxy_SSLMode) EnumDescriptor() ([]byte, []int) {
	return file_contrib_envoy_extensions_filters_network_postgres_proxy_v3alpha_postgres_proxy_proto_rawDescGZIP(), []int{0, 0}
}

// [#next-free-field: 6]
type PostgresProxy struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// The human readable prefix to use when emitting :ref:`statistics
	// <config_network_filters_postgres_proxy_stats>`.
	StatPrefix string `protobuf:"bytes,1,opt,name=stat_prefix,json=statPrefix,proto3" json:"stat_prefix,omitempty"`
	// Controls whether SQL statements received in Frontend Query messages
	// are parsed. Parsing is required to produce Postgres proxy filter
	// metadata. Defaults to true.
	EnableSqlParsing *wrapperspb.BoolValue `protobuf:"bytes,2,opt,name=enable_sql_parsing,json=enableSqlParsing,proto3" json:"enable_sql_parsing,omitempty"`
	// Controls whether to terminate SSL session initiated by a client.
	// If the value is false, the Postgres proxy filter will not try to
	// terminate SSL session, but will pass all the packets to the upstream server.
	// If the value is true, the Postgres proxy filter will try to terminate SSL
	// session. In order to do that, the filter chain must use :ref:`starttls transport socket
	// <envoy_v3_api_msg_extensions.transport_sockets.starttls.v3.StartTlsConfig>`.
	// If the filter does not manage to terminate the SSL session, it will close the connection from the client.
	// Refer to official documentation for details
	// `SSL Session Encryption Message Flow <https://www.postgresql.org/docs/current/protocol-flow.html#id-1.10.5.7.11>`_.
	// This field is deprecated.
	// Please use :ref:`downstream_ssl <envoy_v3_api_field_extensions.filters.network.postgres_proxy.v3alpha.PostgresProxy.downstream_ssl>`.
	//
	// Deprecated: Marked as deprecated in contrib/envoy/extensions/filters/network/postgres_proxy/v3alpha/postgres_proxy.proto.
	TerminateSsl bool `protobuf:"varint,3,opt,name=terminate_ssl,json=terminateSsl,proto3" json:"terminate_ssl,omitempty"`
	// Controls whether to establish upstream SSL connection to the server.
	// Envoy will try to establish upstream SSL connection to the server only when
	// Postgres filter is able to read Postgres payload in clear-text. It happens when
	// a client established a clear-text connection to Envoy or when a client established
	// SSL connection to Envoy and Postgres filter is configured to terminate SSL.
	// In order for upstream encryption to work, the corresponding cluster must be configured to use
	// :ref:`starttls transport socket <envoy_v3_api_msg_extensions.transport_sockets.starttls.v3.UpstreamStartTlsConfig>`.
	// Defaults to “DISABLE“.
	UpstreamSsl PostgresProxy_SSLMode `protobuf:"varint,4,opt,name=upstream_ssl,json=upstreamSsl,proto3,enum=envoy.extensions.filters.network.postgres_proxy.v3alpha.PostgresProxy_SSLMode" json:"upstream_ssl,omitempty"`
	// Controls whether to close downstream connections that refuse to upgrade to SSL.
	// If enabled, the filter chain must use
	// :ref:`starttls transport socket <envoy_v3_api_msg_extensions.transport_sockets.starttls.v3.UpstreamStartTlsConfig>`.
	// Defaults to “DISABLE“.
	DownstreamSsl PostgresProxy_SSLMode `protobuf:"varint,5,opt,name=downstream_ssl,json=downstreamSsl,proto3,enum=envoy.extensions.filters.network.postgres_proxy.v3alpha.PostgresProxy_SSLMode" json:"downstream_ssl,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

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

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

func (*PostgresProxy) ProtoMessage() {}

func (x *PostgresProxy) ProtoReflect() protoreflect.Message {
	mi := &file_contrib_envoy_extensions_filters_network_postgres_proxy_v3alpha_postgres_proxy_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 PostgresProxy.ProtoReflect.Descriptor instead.
func (*PostgresProxy) Descriptor() ([]byte, []int) {
	return file_contrib_envoy_extensions_filters_network_postgres_proxy_v3alpha_postgres_proxy_proto_rawDescGZIP(), []int{0}
}

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

func (x *PostgresProxy) GetEnableSqlParsing() *wrapperspb.BoolValue {
	if x != nil {
		return x.EnableSqlParsing
	}
	return nil
}

// Deprecated: Marked as deprecated in contrib/envoy/extensions/filters/network/postgres_proxy/v3alpha/postgres_proxy.proto.
func (x *PostgresProxy) GetTerminateSsl() bool {
	if x != nil {
		return x.TerminateSsl
	}
	return false
}

func (x *PostgresProxy) GetUpstreamSsl() PostgresProxy_SSLMode {
	if x != nil {
		return x.UpstreamSsl
	}
	return PostgresProxy_DISABLE
}

func (x *PostgresProxy) GetDownstreamSsl() PostgresProxy_SSLMode {
	if x != nil {
		return x.DownstreamSsl
	}
	return PostgresProxy_DISABLE
}

var File_contrib_envoy_extensions_filters_network_postgres_proxy_v3alpha_postgres_proxy_proto protoreflect.FileDescriptor

const file_contrib_envoy_extensions_filters_network_postgres_proxy_v3alpha_postgres_proxy_proto_rawDesc = "" +
	"\n" +
	"Tcontrib/envoy/extensions/filters/network/postgres_proxy/v3alpha/postgres_proxy.proto\x127envoy.extensions.filters.network.postgres_proxy.v3alpha\x1a\x1egoogle/protobuf/wrappers.proto\x1a#envoy/annotations/deprecation.proto\x1a\x1dudpa/annotations/status.proto\x1a\x17validate/validate.proto\"\xcf\x03\n" +
	"\rPostgresProxy\x12(\n" +
	"\vstat_prefix\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\n" +
	"statPrefix\x12H\n" +
	"\x12enable_sql_parsing\x18\x02 \x01(\v2\x1a.google.protobuf.BoolValueR\x10enableSqlParsing\x120\n" +
	"\rterminate_ssl\x18\x03 \x01(\bB\v\x92ǆ\xd8\x04\x033.0\x18\x01R\fterminateSsl\x12q\n" +
	"\fupstream_ssl\x18\x04 \x01(\x0e2N.envoy.extensions.filters.network.postgres_proxy.v3alpha.PostgresProxy.SSLModeR\vupstreamSsl\x12u\n" +
	"\x0edownstream_ssl\x18\x05 \x01(\x0e2N.envoy.extensions.filters.network.postgres_proxy.v3alpha.PostgresProxy.SSLModeR\rdownstreamSsl\".\n" +
	"\aSSLMode\x12\v\n" +
	"\aDISABLE\x10\x00\x12\v\n" +
	"\aREQUIRE\x10\x01\x12\t\n" +
	"\x05ALLOW\x10\x02B\xcf\x01\xba\x80\xc8\xd1\x06\x04\b\x01\x10\x02\n" +
	"Eio.envoyproxy.envoy.extensions.filters.network.postgres_proxy.v3alphaB\x12PostgresProxyProtoP\x01Zfgithub.com/envoyproxy/go-control-plane/contrib/envoy/extensions/filters/network/postgres_proxy/v3alphab\x06proto3"

var (
	file_contrib_envoy_extensions_filters_network_postgres_proxy_v3alpha_postgres_proxy_proto_rawDescOnce sync.Once
	file_contrib_envoy_extensions_filters_network_postgres_proxy_v3alpha_postgres_proxy_proto_rawDescData []byte
)

func file_contrib_envoy_extensions_filters_network_postgres_proxy_v3alpha_postgres_proxy_proto_rawDescGZIP() []byte {
	file_contrib_envoy_extensions_filters_network_postgres_proxy_v3alpha_postgres_proxy_proto_rawDescOnce.Do(func() {
		file_contrib_envoy_extensions_filters_network_postgres_proxy_v3alpha_postgres_proxy_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_contrib_envoy_extensions_filters_network_postgres_proxy_v3alpha_postgres_proxy_proto_rawDesc), len(file_contrib_envoy_extensions_filters_network_postgres_proxy_v3alpha_postgres_proxy_proto_rawDesc)))
	})
	return file_contrib_envoy_extensions_filters_network_postgres_proxy_v3alpha_postgres_proxy_proto_rawDescData
}

var file_contrib_envoy_extensions_filters_network_postgres_proxy_v3alpha_postgres_proxy_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_contrib_envoy_extensions_filters_network_postgres_proxy_v3alpha_postgres_proxy_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_contrib_envoy_extensions_filters_network_postgres_proxy_v3alpha_postgres_proxy_proto_goTypes = []any{
	(PostgresProxy_SSLMode)(0),   // 0: envoy.extensions.filters.network.postgres_proxy.v3alpha.PostgresProxy.SSLMode
	(*PostgresProxy)(nil),        // 1: envoy.extensions.filters.network.postgres_proxy.v3alpha.PostgresProxy
	(*wrapperspb.BoolValue)(nil), // 2: google.protobuf.BoolValue
}
var file_contrib_envoy_extensions_filters_network_postgres_proxy_v3alpha_postgres_proxy_proto_depIdxs = []int32{
	2, // 0: envoy.extensions.filters.network.postgres_proxy.v3alpha.PostgresProxy.enable_sql_parsing:type_name -> google.protobuf.BoolValue
	0, // 1: envoy.extensions.filters.network.postgres_proxy.v3alpha.PostgresProxy.upstream_ssl:type_name -> envoy.extensions.filters.network.postgres_proxy.v3alpha.PostgresProxy.SSLMode
	0, // 2: envoy.extensions.filters.network.postgres_proxy.v3alpha.PostgresProxy.downstream_ssl:type_name -> envoy.extensions.filters.network.postgres_proxy.v3alpha.PostgresProxy.SSLMode
	3, // [3:3] is the sub-list for method output_type
	3, // [3:3] is the sub-list for method input_type
	3, // [3:3] is the sub-list for extension type_name
	3, // [3:3] is the sub-list for extension extendee
	0, // [0:3] is the sub-list for field type_name
}

func init() {
	file_contrib_envoy_extensions_filters_network_postgres_proxy_v3alpha_postgres_proxy_proto_init()
}
func file_contrib_envoy_extensions_filters_network_postgres_proxy_v3alpha_postgres_proxy_proto_init() {
	if File_contrib_envoy_extensions_filters_network_postgres_proxy_v3alpha_postgres_proxy_proto != nil {
		return
	}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_contrib_envoy_extensions_filters_network_postgres_proxy_v3alpha_postgres_proxy_proto_rawDesc), len(file_contrib_envoy_extensions_filters_network_postgres_proxy_v3alpha_postgres_proxy_proto_rawDesc)),
			NumEnums:      1,
			NumMessages:   1,
			NumExtensions: 0,
			NumServices:   0,
		},
		GoTypes:           file_contrib_envoy_extensions_filters_network_postgres_proxy_v3alpha_postgres_proxy_proto_goTypes,
		DependencyIndexes: file_contrib_envoy_extensions_filters_network_postgres_proxy_v3alpha_postgres_proxy_proto_depIdxs,
		EnumInfos:         file_contrib_envoy_extensions_filters_network_postgres_proxy_v3alpha_postgres_proxy_proto_enumTypes,
		MessageInfos:      file_contrib_envoy_extensions_filters_network_postgres_proxy_v3alpha_postgres_proxy_proto_msgTypes,
	}.Build()
	File_contrib_envoy_extensions_filters_network_postgres_proxy_v3alpha_postgres_proxy_proto = out.File
	file_contrib_envoy_extensions_filters_network_postgres_proxy_v3alpha_postgres_proxy_proto_goTypes = nil
	file_contrib_envoy_extensions_filters_network_postgres_proxy_v3alpha_postgres_proxy_proto_depIdxs = nil
}
