diff --git a/Makefile b/Makefile index bdaca573..09b8139f 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ # Image URL to use all building/pushing image targets IMG ?= ${ACC}.dkr.ecr.eu-west-1.amazonaws.com/monzo/egress-operator:manager-$(shell git rev-parse --short head) # Produce CRDs that work back to Kubernetes 1.11 (no version conversion) -CRD_OPTIONS ?= "crd:trivialVersions=false" +CRD_OPTIONS ?= "crd:trivialVersions=true" # Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set) ifeq (,$(shell go env GOBIN)) diff --git a/controllers/configmap.go b/controllers/configmap.go index eaa9a7da..2c1e8bd0 100644 --- a/controllers/configmap.go +++ b/controllers/configmap.go @@ -3,6 +3,8 @@ package controllers import ( "context" "fmt" + //structpb "github.com/golang/protobuf/ptypes/struct" + "google.golang.org/protobuf/types/known/anypb" "google.golang.org/protobuf/types/known/durationpb" "hash/fnv" "strconv" @@ -13,16 +15,16 @@ import ( envoycorev3 "github.com/envoyproxy/go-control-plane/envoy/config/core/v3" envoyendpoint "github.com/envoyproxy/go-control-plane/envoy/config/endpoint/v3" envoylistener "github.com/envoyproxy/go-control-plane/envoy/config/listener/v3" - filev3 "github.com/envoyproxy/go-control-plane/envoy/extensions/access_loggers/file/v3" + streamv3 "github.com/envoyproxy/go-control-plane/envoy/extensions/access_loggers/stream/v3" aggregatev3 "github.com/envoyproxy/go-control-plane/envoy/extensions/clusters/aggregate/v3" tcpproxyv3 "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/network/tcp_proxy/v3" udpproxyv3 "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/udp/udp_proxy/v3" - "github.com/golang/protobuf/ptypes/wrappers" - "google.golang.org/protobuf/types/known/wrapperspb" - "github.com/golang/protobuf/jsonpb" "github.com/golang/protobuf/ptypes" "github.com/golang/protobuf/ptypes/duration" + "github.com/golang/protobuf/ptypes/wrappers" + "google.golang.org/protobuf/types/known/structpb" + "google.golang.org/protobuf/types/known/wrapperspb" corev1 "k8s.io/api/core/v1" apierrs "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -35,6 +37,34 @@ import ( // +kubebuilder:rbac:namespace=egress-operator-system,groups=core,resources=configmaps,verbs=get;list;watch;create;patch +var ( + logFields = &structpb.Struct{ + Fields: map[string]*structpb.Value{ + "authority": {Kind: &structpb.Value_StringValue{StringValue: "%REQ(:AUTHORITY)%"}}, + "bytes_received": {Kind: &structpb.Value_StringValue{StringValue: "%BYTES_RECEIVED%"}}, + "bytes_sent": {Kind: &structpb.Value_StringValue{StringValue: "%BYTES_SENT%"}}, + "connection_termination_details": {Kind: &structpb.Value_StringValue{StringValue: "%CONNECTION_TERMINATION_DETAILS%"}}, + "downstream_local_address": {Kind: &structpb.Value_StringValue{StringValue: "%DOWNSTREAM_LOCAL_ADDRESS%"}}, + "downstream_remote_address": {Kind: &structpb.Value_StringValue{StringValue: "%DOWNSTREAM_REMOTE_ADDRESS%"}}, + "duration": {Kind: &structpb.Value_StringValue{StringValue: "%DURATION%"}}, + "method": {Kind: &structpb.Value_StringValue{StringValue: "%REQ(:METHOD)%"}}, + "path": {Kind: &structpb.Value_StringValue{StringValue: "%REQ(X-ENVOY-ORIGINAL-PATH?:PATH)%"}}, + "protocol": {Kind: &structpb.Value_StringValue{StringValue: "%PROTOCOL%"}}, + "requested_server_name": {Kind: &structpb.Value_StringValue{StringValue: "%REQUESTED_SERVER_NAME%"}}, + "response_code": {Kind: &structpb.Value_StringValue{StringValue: "%RESPONSE_CODE%"}}, + "response_code_details": {Kind: &structpb.Value_StringValue{StringValue: "%RESPONSE_CODE_DETAILS%"}}, + "response_flags": {Kind: &structpb.Value_StringValue{StringValue: "%RESPONSE_FLAGS%"}}, + "start_time": {Kind: &structpb.Value_StringValue{StringValue: "%START_TIME%"}}, + "upstream_cluster": {Kind: &structpb.Value_StringValue{StringValue: "%UPSTREAM_CLUSTER%"}}, + "upstream_host": {Kind: &structpb.Value_StringValue{StringValue: "%UPSTREAM_HOST%"}}, + "upstream_local_address": {Kind: &structpb.Value_StringValue{StringValue: "%UPSTREAM_LOCAL_ADDRESS%"}}, + "upstream_service_time": {Kind: &structpb.Value_StringValue{StringValue: "%RESP(X-ENVOY-UPSTREAM-SERVICE-TIME)%"}}, + "upstream_transport_failure_reason": {Kind: &structpb.Value_StringValue{StringValue: "%UPSTREAM_TRANSPORT_FAILURE_REASON%"}}, + "user_agent": {Kind: &structpb.Value_StringValue{StringValue: "%REQ(USER-AGENT)%"}}, + }, + } +) + func (r *ExternalServiceReconciler) reconcileConfigMap(ctx context.Context, req ctrl.Request, es *egressv1.ExternalService, desired *corev1.ConfigMap) error { if err := ctrl.SetControllerReference(es, desired, r.Scheme); err != nil { return err @@ -86,9 +116,6 @@ func adminPort(es *egressv1.ExternalService) int32 { panic("couldn't find a port for admin listener") } -const accessLogFormat = `[%START_TIME%] %BYTES_RECEIVED% %BYTES_SENT% %DURATION% "%DOWNSTREAM_REMOTE_ADDRESS%" "%UPSTREAM_HOST%" "%UPSTREAM_CLUSTER%" -` - func envoyConfig(es *egressv1.ExternalService) (string, error) { config := bootstrap.Bootstrap{ Node: &envoycorev3.Node{ @@ -197,16 +224,21 @@ func envoyConfig(es *egressv1.ExternalService) (string, error) { var listener *envoylistener.Listener switch protocol { case envoycorev3.SocketAddress_TCP: - accessConfig, err := ptypes.MarshalAny(&filev3.FileAccessLog{ - AccessLogFormat: &filev3.FileAccessLog_Format{ - Format: accessLogFormat, + accessConfig, err := anypb.New(&streamv3.StdoutAccessLog{ + AccessLogFormat: &streamv3.StdoutAccessLog_LogFormat{ + LogFormat: &envoycorev3.SubstitutionFormatString{ + Format: &envoycorev3.SubstitutionFormatString_JsonFormat{ + JsonFormat: logFields, + }, + OmitEmptyValues: true, + ContentType: "application/json; charset=UTF-8", + JsonFormatOptions: nil, + }, }, - Path: "/dev/stdout", }) - - filterConfig, err := ptypes.MarshalAny(&tcpproxyv3.TcpProxy{ + filterConfig, err := anypb.New(&tcpproxyv3.TcpProxy{ AccessLog: []*accesslogfilterv3.AccessLog{{ - Name: "envoy.file_access_log", + Name: "envoy.stdout_access_log", ConfigType: &accesslogfilterv3.AccessLog_TypedConfig{TypedConfig: accessConfig}, }}, StatPrefix: "tcp_proxy", @@ -236,7 +268,7 @@ func envoyConfig(es *egressv1.ExternalService) (string, error) { }}}}}, } case envoycorev3.SocketAddress_UDP: - filterConfig, err := ptypes.MarshalAny(&udpproxyv3.UdpProxyConfig{ + filterConfig, err := anypb.New(&udpproxyv3.UdpProxyConfig{ StatPrefix: "udp_proxy", RouteSpecifier: &udpproxyv3.UdpProxyConfig_Cluster{ Cluster: name, diff --git a/controllers/configmap_test.go b/controllers/configmap_test.go index 6d71cec2..e3703df3 100644 --- a/controllers/configmap_test.go +++ b/controllers/configmap_test.go @@ -1,9 +1,11 @@ package controllers import ( + bootstrap "github.com/envoyproxy/go-control-plane/envoy/config/bootstrap/v3" + "github.com/google/go-cmp/cmp" + "sigs.k8s.io/yaml" "testing" - "github.com/google/go-cmp/cmp" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -97,12 +99,34 @@ staticResources: typedConfig: '@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy accessLog: - - name: envoy.file_access_log + - name: envoy.stdout_access_log typedConfig: - '@type': type.googleapis.com/envoy.extensions.access_loggers.file.v3.FileAccessLog - format: | - [%START_TIME%] %BYTES_RECEIVED% %BYTES_SENT% %DURATION% "%DOWNSTREAM_REMOTE_ADDRESS%" "%UPSTREAM_HOST%" "%UPSTREAM_CLUSTER%" - path: /dev/stdout + '@type': type.googleapis.com/envoy.extensions.access_loggers.stream.v3.StdoutAccessLog + logFormat: + contentType: application/json; charset=UTF-8 + jsonFormat: + authority: '%REQ(:AUTHORITY)%' + bytes_received: '%BYTES_RECEIVED%' + bytes_sent: '%BYTES_SENT%' + connection_termination_details: '%CONNECTION_TERMINATION_DETAILS%' + downstream_local_address: '%DOWNSTREAM_LOCAL_ADDRESS%' + downstream_remote_address: '%DOWNSTREAM_REMOTE_ADDRESS%' + duration: '%DURATION%' + method: '%REQ(:METHOD)%' + path: '%REQ(X-ENVOY-ORIGINAL-PATH?:PATH)%' + protocol: '%PROTOCOL%' + requested_server_name: '%REQUESTED_SERVER_NAME%' + response_code: '%RESPONSE_CODE%' + response_code_details: '%RESPONSE_CODE_DETAILS%' + response_flags: '%RESPONSE_FLAGS%' + start_time: '%START_TIME%' + upstream_cluster: '%UPSTREAM_CLUSTER%' + upstream_host: '%UPSTREAM_HOST%' + upstream_local_address: '%UPSTREAM_LOCAL_ADDRESS%' + upstream_service_time: '%RESP(X-ENVOY-UPSTREAM-SERVICE-TIME)%' + upstream_transport_failure_reason: '%UPSTREAM_TRANSPORT_FAILURE_REASON%' + user_agent: '%REQ(USER-AGENT)%' + omitEmptyValues: true cluster: foo_TCP_101 statPrefix: tcp_proxy name: foo_TCP_101 @@ -209,12 +233,34 @@ staticResources: typedConfig: '@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy accessLog: - - name: envoy.file_access_log + - name: envoy.stdout_access_log typedConfig: - '@type': type.googleapis.com/envoy.extensions.access_loggers.file.v3.FileAccessLog - format: | - [%START_TIME%] %BYTES_RECEIVED% %BYTES_SENT% %DURATION% "%DOWNSTREAM_REMOTE_ADDRESS%" "%UPSTREAM_HOST%" "%UPSTREAM_CLUSTER%" - path: /dev/stdout + '@type': type.googleapis.com/envoy.extensions.access_loggers.stream.v3.StdoutAccessLog + logFormat: + contentType: application/json; charset=UTF-8 + jsonFormat: + authority: '%REQ(:AUTHORITY)%' + bytes_received: '%BYTES_RECEIVED%' + bytes_sent: '%BYTES_SENT%' + connection_termination_details: '%CONNECTION_TERMINATION_DETAILS%' + downstream_local_address: '%DOWNSTREAM_LOCAL_ADDRESS%' + downstream_remote_address: '%DOWNSTREAM_REMOTE_ADDRESS%' + duration: '%DURATION%' + method: '%REQ(:METHOD)%' + path: '%REQ(X-ENVOY-ORIGINAL-PATH?:PATH)%' + protocol: '%PROTOCOL%' + requested_server_name: '%REQUESTED_SERVER_NAME%' + response_code: '%RESPONSE_CODE%' + response_code_details: '%RESPONSE_CODE_DETAILS%' + response_flags: '%RESPONSE_FLAGS%' + start_time: '%START_TIME%' + upstream_cluster: '%UPSTREAM_CLUSTER%' + upstream_host: '%UPSTREAM_HOST%' + upstream_local_address: '%UPSTREAM_LOCAL_ADDRESS%' + upstream_service_time: '%RESP(X-ENVOY-UPSTREAM-SERVICE-TIME)%' + upstream_transport_failure_reason: '%UPSTREAM_TRANSPORT_FAILURE_REASON%' + user_agent: '%REQ(USER-AGENT)%' + omitEmptyValues: true cluster: foo_TCP_101 statPrefix: tcp_proxy name: foo_TCP_101 @@ -246,7 +292,15 @@ staticResources: for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { tt.args.es.Spec.EnvoyClusterMaxConnections = tt.args.maxConns + got, _ := envoyConfig(tt.args.es) + + var x bootstrap.Bootstrap + err := yaml.Unmarshal([]byte(got), &x) + if err != nil { + t.Error() + } if got, _ := envoyConfig(tt.args.es); got != tt.want { + t.Errorf("envoyConfig() = %v, want %v", got, tt.want) t.Error(cmp.Diff(got, tt.want)) } diff --git a/controllers/testdata/expected_udp_tcp.yaml b/controllers/testdata/expected_udp_tcp.yaml new file mode 100644 index 00000000..ed409f9b --- /dev/null +++ b/controllers/testdata/expected_udp_tcp.yaml @@ -0,0 +1,102 @@ +admin: + accessLogPath: /dev/stdout + address: + socketAddress: + address: 0.0.0.0 + portValue: 11000 +node: + cluster: foo +staticResources: + clusters: + - connectTimeout: 1s + dnsLookupFamily: V4_ONLY + loadAssignment: + clusterName: foo_UDP_100 + endpoints: + - lbEndpoints: + - endpoint: + address: + socketAddress: + address: google.com + portValue: 100 + protocol: UDP + name: foo_UDP_100 + type: LOGICAL_DNS + upstreamConnectionOptions: + tcpKeepalive: + keepaliveInterval: 5 + keepaliveProbes: 3 + keepaliveTime: 30 + - connectTimeout: 1s + dnsLookupFamily: V4_ONLY + loadAssignment: + clusterName: foo_TCP_101 + endpoints: + - lbEndpoints: + - endpoint: + address: + socketAddress: + address: google.com + portValue: 101 + name: foo_TCP_101 + type: LOGICAL_DNS + upstreamConnectionOptions: + tcpKeepalive: + keepaliveInterval: 5 + keepaliveProbes: 3 + keepaliveTime: 30 + listeners: + - address: + socketAddress: + address: 0.0.0.0 + portValue: 100 + protocol: UDP + filterChains: + - filters: + - name: envoy.filters.udp_listener.udp_proxy + typedConfig: + "@type": type.googleapis.com/envoy.extensions.filters.udp.udp_proxy.v3.UdpProxyConfig + cluster: foo_UDP_100 + statPrefix: udp_proxy + name: foo_UDP_100 + - address: + socketAddress: + address: 0.0.0.0 + portValue: 101 + filterChains: + - filters: + - name: envoy.tcp_proxy + typedConfig: + '@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy + accessLog: + - name: envoy.stdout_access_log + typedConfig: + '@type': type.googleapis.com/envoy.extensions.access_loggers.stream.v3.StdoutAccessLog + logFormat: + contentType: "application/json; charset=UTF-8" + jsonFormat: + authority: '%REQ(:AUTHORITY)%' + bytes_received: '%BYTES_RECEIVED%' + bytes_sent: '%BYTES_SENT%' + connection_termination_details: '%CONNECTION_TERMINATION_DETAILS%' + downstream_local_address: '%DOWNSTREAM_LOCAL_ADDRESS%' + downstream_remote_address: '%DOWNSTREAM_REMOTE_ADDRESS%' + duration: '%DURATION%' + method: '%REQ(:METHOD)%' + path: '%REQ(X-ENVOY-ORIGINAL-PATH?:PATH)%' + protocol: '%PROTOCOL%' + requested_server_name: '%REQUESTED_SERVER_NAME%' + response_code: '%RESPONSE_CODE%' + response_code_details: '%RESPONSE_CODE_DETAILS%' + response_flags: '%RESPONSE_FLAGS%' + start_time: '%START__TIME%' + upstream_cluster: '%UPSTREAM_CLUSTER%' + upstream_host: '%UPSTREAM_HOST%' + upstream_local_address: '%UPSTREAM_LOCAL_ADDRESS%' + upstream_service_time: '%RESP(X-ENVOY-UPSTREAM-SERVICE-TIME)%' + upstream_transport_failure_reason: '%UPSTREAM_TRANSPORT_FAILURE_REASON%' + user_agent: '%REQ(USER-AGENT)%' + omitEmptyValues: True + cluster: "foo_TCP_101" + statPrefix: "tcp_proxy" + name: foo_TCP_101 \ No newline at end of file diff --git a/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/access_loggers/file/v3/file.pb.go b/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/access_loggers/file/v3/file.pb.go deleted file mode 100644 index e903153b..00000000 --- a/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/access_loggers/file/v3/file.pb.go +++ /dev/null @@ -1,308 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.1 -// protoc v3.21.12 -// source: envoy/extensions/access_loggers/file/v3/file.proto - -package filev3 - -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" - _struct "github.com/golang/protobuf/ptypes/struct" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -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) -) - -// Custom configuration for an :ref:`AccessLog ` -// that writes log entries directly to a file. Configures the built-in ``envoy.access_loggers.file`` -// AccessLog. -// [#next-free-field: 6] -type FileAccessLog struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // A path to a local file to which to write the access log entries. - Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` - // Types that are assignable to AccessLogFormat: - // *FileAccessLog_Format - // *FileAccessLog_JsonFormat - // *FileAccessLog_TypedJsonFormat - // *FileAccessLog_LogFormat - AccessLogFormat isFileAccessLog_AccessLogFormat `protobuf_oneof:"access_log_format"` -} - -func (x *FileAccessLog) Reset() { - *x = FileAccessLog{} - if protoimpl.UnsafeEnabled { - mi := &file_envoy_extensions_access_loggers_file_v3_file_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *FileAccessLog) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FileAccessLog) ProtoMessage() {} - -func (x *FileAccessLog) ProtoReflect() protoreflect.Message { - mi := &file_envoy_extensions_access_loggers_file_v3_file_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use FileAccessLog.ProtoReflect.Descriptor instead. -func (*FileAccessLog) Descriptor() ([]byte, []int) { - return file_envoy_extensions_access_loggers_file_v3_file_proto_rawDescGZIP(), []int{0} -} - -func (x *FileAccessLog) GetPath() string { - if x != nil { - return x.Path - } - return "" -} - -func (m *FileAccessLog) GetAccessLogFormat() isFileAccessLog_AccessLogFormat { - if m != nil { - return m.AccessLogFormat - } - return nil -} - -// Deprecated: Do not use. -func (x *FileAccessLog) GetFormat() string { - if x, ok := x.GetAccessLogFormat().(*FileAccessLog_Format); ok { - return x.Format - } - return "" -} - -// Deprecated: Do not use. -func (x *FileAccessLog) GetJsonFormat() *_struct.Struct { - if x, ok := x.GetAccessLogFormat().(*FileAccessLog_JsonFormat); ok { - return x.JsonFormat - } - return nil -} - -// Deprecated: Do not use. -func (x *FileAccessLog) GetTypedJsonFormat() *_struct.Struct { - if x, ok := x.GetAccessLogFormat().(*FileAccessLog_TypedJsonFormat); ok { - return x.TypedJsonFormat - } - return nil -} - -func (x *FileAccessLog) GetLogFormat() *v3.SubstitutionFormatString { - if x, ok := x.GetAccessLogFormat().(*FileAccessLog_LogFormat); ok { - return x.LogFormat - } - return nil -} - -type isFileAccessLog_AccessLogFormat interface { - isFileAccessLog_AccessLogFormat() -} - -type FileAccessLog_Format struct { - // Access log :ref:`format string`. - // Envoy supports :ref:`custom access log formats ` as well as a - // :ref:`default format `. - // This field is deprecated. - // Please use :ref:`log_format `. - // - // Deprecated: Do not use. - Format string `protobuf:"bytes,2,opt,name=format,proto3,oneof"` -} - -type FileAccessLog_JsonFormat struct { - // Access log :ref:`format dictionary`. All values - // are rendered as strings. - // This field is deprecated. - // Please use :ref:`log_format `. - // - // Deprecated: Do not use. - JsonFormat *_struct.Struct `protobuf:"bytes,3,opt,name=json_format,json=jsonFormat,proto3,oneof"` -} - -type FileAccessLog_TypedJsonFormat struct { - // Access log :ref:`format dictionary`. Values are - // rendered as strings, numbers, or boolean values as appropriate. Nested JSON objects may - // be produced by some command operators (e.g.FILTER_STATE or DYNAMIC_METADATA). See the - // documentation for a specific command operator for details. - // This field is deprecated. - // Please use :ref:`log_format `. - // - // Deprecated: Do not use. - TypedJsonFormat *_struct.Struct `protobuf:"bytes,4,opt,name=typed_json_format,json=typedJsonFormat,proto3,oneof"` -} - -type FileAccessLog_LogFormat struct { - // Configuration to form access log data and format. - // If not specified, use :ref:`default format `. - LogFormat *v3.SubstitutionFormatString `protobuf:"bytes,5,opt,name=log_format,json=logFormat,proto3,oneof"` -} - -func (*FileAccessLog_Format) isFileAccessLog_AccessLogFormat() {} - -func (*FileAccessLog_JsonFormat) isFileAccessLog_AccessLogFormat() {} - -func (*FileAccessLog_TypedJsonFormat) isFileAccessLog_AccessLogFormat() {} - -func (*FileAccessLog_LogFormat) isFileAccessLog_AccessLogFormat() {} - -var File_envoy_extensions_access_loggers_file_v3_file_proto protoreflect.FileDescriptor - -var file_envoy_extensions_access_loggers_file_v3_file_proto_rawDesc = []byte{ - 0x0a, 0x32, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, - 0x6e, 0x73, 0x2f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x6c, 0x6f, 0x67, 0x67, 0x65, 0x72, - 0x73, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x2f, 0x76, 0x33, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x27, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x65, 0x78, 0x74, 0x65, - 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x6c, 0x6f, - 0x67, 0x67, 0x65, 0x72, 0x73, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x76, 0x33, 0x1a, 0x35, 0x65, - 0x6e, 0x76, 0x6f, 0x79, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x63, 0x6f, 0x72, 0x65, - 0x2f, 0x76, 0x33, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x74, 0x69, 0x74, 0x75, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x23, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x75, 0x64, 0x70, 0x61, 0x2f, 0x61, 0x6e, - 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x21, 0x75, 0x64, 0x70, 0x61, 0x2f, 0x61, 0x6e, 0x6e, - 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x69, 0x6e, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x22, 0x90, 0x03, 0x0a, 0x0d, 0x46, 0x69, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x65, 0x73, - 0x73, 0x4c, 0x6f, 0x67, 0x12, 0x1b, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x04, 0x70, 0x61, 0x74, - 0x68, 0x12, 0x25, 0x0a, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x0b, 0x18, 0x01, 0x92, 0xc7, 0x86, 0xd8, 0x04, 0x03, 0x33, 0x2e, 0x30, 0x48, 0x00, - 0x52, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x47, 0x0a, 0x0b, 0x6a, 0x73, 0x6f, 0x6e, - 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x42, 0x0b, 0x18, 0x01, 0x92, 0xc7, 0x86, 0xd8, 0x04, 0x03, - 0x33, 0x2e, 0x30, 0x48, 0x00, 0x52, 0x0a, 0x6a, 0x73, 0x6f, 0x6e, 0x46, 0x6f, 0x72, 0x6d, 0x61, - 0x74, 0x12, 0x52, 0x0a, 0x11, 0x74, 0x79, 0x70, 0x65, 0x64, 0x5f, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, - 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, - 0x74, 0x72, 0x75, 0x63, 0x74, 0x42, 0x0b, 0x18, 0x01, 0x92, 0xc7, 0x86, 0xd8, 0x04, 0x03, 0x33, - 0x2e, 0x30, 0x48, 0x00, 0x52, 0x0f, 0x74, 0x79, 0x70, 0x65, 0x64, 0x4a, 0x73, 0x6f, 0x6e, 0x46, - 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x59, 0x0a, 0x0a, 0x6c, 0x6f, 0x67, 0x5f, 0x66, 0x6f, 0x72, - 0x6d, 0x61, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x65, 0x6e, 0x76, 0x6f, - 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x33, - 0x2e, 0x53, 0x75, 0x62, 0x73, 0x74, 0x69, 0x74, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x6f, 0x72, - 0x6d, 0x61, 0x74, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, - 0x02, 0x10, 0x01, 0x48, 0x00, 0x52, 0x09, 0x6c, 0x6f, 0x67, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, - 0x3a, 0x2e, 0x9a, 0xc5, 0x88, 0x1e, 0x29, 0x0a, 0x27, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x63, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x6c, 0x6f, 0x67, 0x2e, - 0x76, 0x32, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4c, 0x6f, 0x67, - 0x42, 0x13, 0x0a, 0x11, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x6c, 0x6f, 0x67, 0x5f, 0x66, - 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x42, 0xa3, 0x01, 0x0a, 0x35, 0x69, 0x6f, 0x2e, 0x65, 0x6e, 0x76, - 0x6f, 0x79, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x65, 0x78, - 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, - 0x6c, 0x6f, 0x67, 0x67, 0x65, 0x72, 0x73, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x76, 0x33, 0x42, - 0x09, 0x46, 0x69, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x55, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x70, 0x72, - 0x6f, 0x78, 0x79, 0x2f, 0x67, 0x6f, 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2d, 0x70, - 0x6c, 0x61, 0x6e, 0x65, 0x2f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2f, 0x65, 0x78, 0x74, 0x65, 0x6e, - 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x6c, 0x6f, 0x67, - 0x67, 0x65, 0x72, 0x73, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x2f, 0x76, 0x33, 0x3b, 0x66, 0x69, 0x6c, - 0x65, 0x76, 0x33, 0xba, 0x80, 0xc8, 0xd1, 0x06, 0x02, 0x10, 0x02, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, -} - -var ( - file_envoy_extensions_access_loggers_file_v3_file_proto_rawDescOnce sync.Once - file_envoy_extensions_access_loggers_file_v3_file_proto_rawDescData = file_envoy_extensions_access_loggers_file_v3_file_proto_rawDesc -) - -func file_envoy_extensions_access_loggers_file_v3_file_proto_rawDescGZIP() []byte { - file_envoy_extensions_access_loggers_file_v3_file_proto_rawDescOnce.Do(func() { - file_envoy_extensions_access_loggers_file_v3_file_proto_rawDescData = protoimpl.X.CompressGZIP(file_envoy_extensions_access_loggers_file_v3_file_proto_rawDescData) - }) - return file_envoy_extensions_access_loggers_file_v3_file_proto_rawDescData -} - -var file_envoy_extensions_access_loggers_file_v3_file_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_envoy_extensions_access_loggers_file_v3_file_proto_goTypes = []interface{}{ - (*FileAccessLog)(nil), // 0: envoy.extensions.access_loggers.file.v3.FileAccessLog - (*_struct.Struct)(nil), // 1: google.protobuf.Struct - (*v3.SubstitutionFormatString)(nil), // 2: envoy.config.core.v3.SubstitutionFormatString -} -var file_envoy_extensions_access_loggers_file_v3_file_proto_depIdxs = []int32{ - 1, // 0: envoy.extensions.access_loggers.file.v3.FileAccessLog.json_format:type_name -> google.protobuf.Struct - 1, // 1: envoy.extensions.access_loggers.file.v3.FileAccessLog.typed_json_format:type_name -> google.protobuf.Struct - 2, // 2: envoy.extensions.access_loggers.file.v3.FileAccessLog.log_format:type_name -> envoy.config.core.v3.SubstitutionFormatString - 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_envoy_extensions_access_loggers_file_v3_file_proto_init() } -func file_envoy_extensions_access_loggers_file_v3_file_proto_init() { - if File_envoy_extensions_access_loggers_file_v3_file_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_envoy_extensions_access_loggers_file_v3_file_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FileAccessLog); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_envoy_extensions_access_loggers_file_v3_file_proto_msgTypes[0].OneofWrappers = []interface{}{ - (*FileAccessLog_Format)(nil), - (*FileAccessLog_JsonFormat)(nil), - (*FileAccessLog_TypedJsonFormat)(nil), - (*FileAccessLog_LogFormat)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_envoy_extensions_access_loggers_file_v3_file_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_envoy_extensions_access_loggers_file_v3_file_proto_goTypes, - DependencyIndexes: file_envoy_extensions_access_loggers_file_v3_file_proto_depIdxs, - MessageInfos: file_envoy_extensions_access_loggers_file_v3_file_proto_msgTypes, - }.Build() - File_envoy_extensions_access_loggers_file_v3_file_proto = out.File - file_envoy_extensions_access_loggers_file_v3_file_proto_rawDesc = nil - file_envoy_extensions_access_loggers_file_v3_file_proto_goTypes = nil - file_envoy_extensions_access_loggers_file_v3_file_proto_depIdxs = nil -} diff --git a/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/access_loggers/file/v3/file.pb.validate.go b/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/access_loggers/file/v3/file.pb.validate.go deleted file mode 100644 index f302e066..00000000 --- a/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/access_loggers/file/v3/file.pb.validate.go +++ /dev/null @@ -1,298 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: envoy/extensions/access_loggers/file/v3/file.proto - -package filev3 - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort -) - -// Validate checks the field values on FileAccessLog with the rules defined in -// the proto definition for this message. If any rules are violated, the first -// error encountered is returned, or nil if there are no violations. -func (m *FileAccessLog) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on FileAccessLog with the rules defined -// in the proto definition for this message. If any rules are violated, the -// result is a list of violation errors wrapped in FileAccessLogMultiError, or -// nil if none found. -func (m *FileAccessLog) ValidateAll() error { - return m.validate(true) -} - -func (m *FileAccessLog) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetPath()) < 1 { - err := FileAccessLogValidationError{ - field: "Path", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - switch v := m.AccessLogFormat.(type) { - case *FileAccessLog_Format: - if v == nil { - err := FileAccessLogValidationError{ - field: "AccessLogFormat", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - // no validation rules for Format - case *FileAccessLog_JsonFormat: - if v == nil { - err := FileAccessLogValidationError{ - field: "AccessLogFormat", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetJsonFormat()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, FileAccessLogValidationError{ - field: "JsonFormat", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, FileAccessLogValidationError{ - field: "JsonFormat", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetJsonFormat()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return FileAccessLogValidationError{ - field: "JsonFormat", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *FileAccessLog_TypedJsonFormat: - if v == nil { - err := FileAccessLogValidationError{ - field: "AccessLogFormat", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetTypedJsonFormat()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, FileAccessLogValidationError{ - field: "TypedJsonFormat", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, FileAccessLogValidationError{ - field: "TypedJsonFormat", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetTypedJsonFormat()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return FileAccessLogValidationError{ - field: "TypedJsonFormat", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *FileAccessLog_LogFormat: - if v == nil { - err := FileAccessLogValidationError{ - field: "AccessLogFormat", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if m.GetLogFormat() == nil { - err := FileAccessLogValidationError{ - field: "LogFormat", - reason: "value is required", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetLogFormat()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, FileAccessLogValidationError{ - field: "LogFormat", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, FileAccessLogValidationError{ - field: "LogFormat", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetLogFormat()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return FileAccessLogValidationError{ - field: "LogFormat", - reason: "embedded message failed validation", - cause: err, - } - } - } - - default: - _ = v // ensures v is used - } - - if len(errors) > 0 { - return FileAccessLogMultiError(errors) - } - - return nil -} - -// FileAccessLogMultiError is an error wrapping multiple validation errors -// returned by FileAccessLog.ValidateAll() if the designated constraints -// aren't met. -type FileAccessLogMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m FileAccessLogMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m FileAccessLogMultiError) AllErrors() []error { return m } - -// FileAccessLogValidationError is the validation error returned by -// FileAccessLog.Validate if the designated constraints aren't met. -type FileAccessLogValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e FileAccessLogValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e FileAccessLogValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e FileAccessLogValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e FileAccessLogValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e FileAccessLogValidationError) ErrorName() string { return "FileAccessLogValidationError" } - -// Error satisfies the builtin error interface -func (e FileAccessLogValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sFileAccessLog.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = FileAccessLogValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = FileAccessLogValidationError{} diff --git a/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/access_loggers/stream/v3/stream.pb.go b/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/access_loggers/stream/v3/stream.pb.go new file mode 100644 index 00000000..fb7a2122 --- /dev/null +++ b/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/access_loggers/stream/v3/stream.pb.go @@ -0,0 +1,297 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.21.12 +// source: envoy/extensions/access_loggers/stream/v3/stream.proto + +package streamv3 + +import ( + _ "github.com/cncf/xds/go/udpa/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" + reflect "reflect" + sync "sync" +) + +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) +) + +// Custom configuration for an :ref:`AccessLog ` +// that writes log entries directly to the operating system's standard output. +// [#extension: envoy.access_loggers.stdout] +type StdoutAccessLog struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to AccessLogFormat: + // *StdoutAccessLog_LogFormat + AccessLogFormat isStdoutAccessLog_AccessLogFormat `protobuf_oneof:"access_log_format"` +} + +func (x *StdoutAccessLog) Reset() { + *x = StdoutAccessLog{} + if protoimpl.UnsafeEnabled { + mi := &file_envoy_extensions_access_loggers_stream_v3_stream_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StdoutAccessLog) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StdoutAccessLog) ProtoMessage() {} + +func (x *StdoutAccessLog) ProtoReflect() protoreflect.Message { + mi := &file_envoy_extensions_access_loggers_stream_v3_stream_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StdoutAccessLog.ProtoReflect.Descriptor instead. +func (*StdoutAccessLog) Descriptor() ([]byte, []int) { + return file_envoy_extensions_access_loggers_stream_v3_stream_proto_rawDescGZIP(), []int{0} +} + +func (m *StdoutAccessLog) GetAccessLogFormat() isStdoutAccessLog_AccessLogFormat { + if m != nil { + return m.AccessLogFormat + } + return nil +} + +func (x *StdoutAccessLog) GetLogFormat() *v3.SubstitutionFormatString { + if x, ok := x.GetAccessLogFormat().(*StdoutAccessLog_LogFormat); ok { + return x.LogFormat + } + return nil +} + +type isStdoutAccessLog_AccessLogFormat interface { + isStdoutAccessLog_AccessLogFormat() +} + +type StdoutAccessLog_LogFormat struct { + // Configuration to form access log data and format. + // If not specified, use :ref:`default format `. + LogFormat *v3.SubstitutionFormatString `protobuf:"bytes,1,opt,name=log_format,json=logFormat,proto3,oneof"` +} + +func (*StdoutAccessLog_LogFormat) isStdoutAccessLog_AccessLogFormat() {} + +// Custom configuration for an :ref:`AccessLog ` +// that writes log entries directly to the operating system's standard error. +// [#extension: envoy.access_loggers.stderr] +type StderrAccessLog struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to AccessLogFormat: + // *StderrAccessLog_LogFormat + AccessLogFormat isStderrAccessLog_AccessLogFormat `protobuf_oneof:"access_log_format"` +} + +func (x *StderrAccessLog) Reset() { + *x = StderrAccessLog{} + if protoimpl.UnsafeEnabled { + mi := &file_envoy_extensions_access_loggers_stream_v3_stream_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StderrAccessLog) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StderrAccessLog) ProtoMessage() {} + +func (x *StderrAccessLog) ProtoReflect() protoreflect.Message { + mi := &file_envoy_extensions_access_loggers_stream_v3_stream_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StderrAccessLog.ProtoReflect.Descriptor instead. +func (*StderrAccessLog) Descriptor() ([]byte, []int) { + return file_envoy_extensions_access_loggers_stream_v3_stream_proto_rawDescGZIP(), []int{1} +} + +func (m *StderrAccessLog) GetAccessLogFormat() isStderrAccessLog_AccessLogFormat { + if m != nil { + return m.AccessLogFormat + } + return nil +} + +func (x *StderrAccessLog) GetLogFormat() *v3.SubstitutionFormatString { + if x, ok := x.GetAccessLogFormat().(*StderrAccessLog_LogFormat); ok { + return x.LogFormat + } + return nil +} + +type isStderrAccessLog_AccessLogFormat interface { + isStderrAccessLog_AccessLogFormat() +} + +type StderrAccessLog_LogFormat struct { + // Configuration to form access log data and format. + // If not specified, use :ref:`default format `. + LogFormat *v3.SubstitutionFormatString `protobuf:"bytes,1,opt,name=log_format,json=logFormat,proto3,oneof"` +} + +func (*StderrAccessLog_LogFormat) isStderrAccessLog_AccessLogFormat() {} + +var File_envoy_extensions_access_loggers_stream_v3_stream_proto protoreflect.FileDescriptor + +var file_envoy_extensions_access_loggers_stream_v3_stream_proto_rawDesc = []byte{ + 0x0a, 0x36, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, + 0x6e, 0x73, 0x2f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x6c, 0x6f, 0x67, 0x67, 0x65, 0x72, + 0x73, 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2f, 0x76, 0x33, 0x2f, 0x73, 0x74, 0x72, 0x65, + 0x61, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x29, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, + 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x65, 0x73, + 0x73, 0x5f, 0x6c, 0x6f, 0x67, 0x67, 0x65, 0x72, 0x73, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, + 0x2e, 0x76, 0x33, 0x1a, 0x35, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x33, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x74, 0x69, + 0x74, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x5f, 0x73, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x75, 0x64, 0x70, 0x61, + 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x22, 0x81, 0x01, 0x0a, 0x0f, 0x53, 0x74, 0x64, 0x6f, 0x75, 0x74, 0x41, 0x63, 0x63, + 0x65, 0x73, 0x73, 0x4c, 0x6f, 0x67, 0x12, 0x59, 0x0a, 0x0a, 0x6c, 0x6f, 0x67, 0x5f, 0x66, 0x6f, + 0x72, 0x6d, 0x61, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x65, 0x6e, 0x76, + 0x6f, 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, + 0x33, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x74, 0x69, 0x74, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x6f, + 0x72, 0x6d, 0x61, 0x74, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, + 0x01, 0x02, 0x10, 0x01, 0x48, 0x00, 0x52, 0x09, 0x6c, 0x6f, 0x67, 0x46, 0x6f, 0x72, 0x6d, 0x61, + 0x74, 0x42, 0x13, 0x0a, 0x11, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x6c, 0x6f, 0x67, 0x5f, + 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x22, 0x81, 0x01, 0x0a, 0x0f, 0x53, 0x74, 0x64, 0x65, 0x72, + 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4c, 0x6f, 0x67, 0x12, 0x59, 0x0a, 0x0a, 0x6c, 0x6f, + 0x67, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, + 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x63, 0x6f, + 0x72, 0x65, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x74, 0x69, 0x74, 0x75, 0x74, 0x69, + 0x6f, 0x6e, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x42, 0x08, + 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x48, 0x00, 0x52, 0x09, 0x6c, 0x6f, 0x67, 0x46, + 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x42, 0x13, 0x0a, 0x11, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, + 0x6c, 0x6f, 0x67, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x42, 0xab, 0x01, 0x0a, 0x37, 0x69, + 0x6f, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x65, 0x6e, 0x76, + 0x6f, 0x79, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x61, 0x63, + 0x63, 0x65, 0x73, 0x73, 0x5f, 0x6c, 0x6f, 0x67, 0x67, 0x65, 0x72, 0x73, 0x2e, 0x73, 0x74, 0x72, + 0x65, 0x61, 0x6d, 0x2e, 0x76, 0x33, 0x42, 0x0b, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x59, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x67, 0x6f, 0x2d, + 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2d, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2f, 0x65, 0x6e, + 0x76, 0x6f, 0x79, 0x2f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, + 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x6c, 0x6f, 0x67, 0x67, 0x65, 0x72, 0x73, 0x2f, 0x73, 0x74, + 0x72, 0x65, 0x61, 0x6d, 0x2f, 0x76, 0x33, 0x3b, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x76, 0x33, + 0xba, 0x80, 0xc8, 0xd1, 0x06, 0x02, 0x10, 0x02, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_envoy_extensions_access_loggers_stream_v3_stream_proto_rawDescOnce sync.Once + file_envoy_extensions_access_loggers_stream_v3_stream_proto_rawDescData = file_envoy_extensions_access_loggers_stream_v3_stream_proto_rawDesc +) + +func file_envoy_extensions_access_loggers_stream_v3_stream_proto_rawDescGZIP() []byte { + file_envoy_extensions_access_loggers_stream_v3_stream_proto_rawDescOnce.Do(func() { + file_envoy_extensions_access_loggers_stream_v3_stream_proto_rawDescData = protoimpl.X.CompressGZIP(file_envoy_extensions_access_loggers_stream_v3_stream_proto_rawDescData) + }) + return file_envoy_extensions_access_loggers_stream_v3_stream_proto_rawDescData +} + +var file_envoy_extensions_access_loggers_stream_v3_stream_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_envoy_extensions_access_loggers_stream_v3_stream_proto_goTypes = []interface{}{ + (*StdoutAccessLog)(nil), // 0: envoy.extensions.access_loggers.stream.v3.StdoutAccessLog + (*StderrAccessLog)(nil), // 1: envoy.extensions.access_loggers.stream.v3.StderrAccessLog + (*v3.SubstitutionFormatString)(nil), // 2: envoy.config.core.v3.SubstitutionFormatString +} +var file_envoy_extensions_access_loggers_stream_v3_stream_proto_depIdxs = []int32{ + 2, // 0: envoy.extensions.access_loggers.stream.v3.StdoutAccessLog.log_format:type_name -> envoy.config.core.v3.SubstitutionFormatString + 2, // 1: envoy.extensions.access_loggers.stream.v3.StderrAccessLog.log_format:type_name -> envoy.config.core.v3.SubstitutionFormatString + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_envoy_extensions_access_loggers_stream_v3_stream_proto_init() } +func file_envoy_extensions_access_loggers_stream_v3_stream_proto_init() { + if File_envoy_extensions_access_loggers_stream_v3_stream_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_envoy_extensions_access_loggers_stream_v3_stream_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StdoutAccessLog); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_envoy_extensions_access_loggers_stream_v3_stream_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StderrAccessLog); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_envoy_extensions_access_loggers_stream_v3_stream_proto_msgTypes[0].OneofWrappers = []interface{}{ + (*StdoutAccessLog_LogFormat)(nil), + } + file_envoy_extensions_access_loggers_stream_v3_stream_proto_msgTypes[1].OneofWrappers = []interface{}{ + (*StderrAccessLog_LogFormat)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_envoy_extensions_access_loggers_stream_v3_stream_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_envoy_extensions_access_loggers_stream_v3_stream_proto_goTypes, + DependencyIndexes: file_envoy_extensions_access_loggers_stream_v3_stream_proto_depIdxs, + MessageInfos: file_envoy_extensions_access_loggers_stream_v3_stream_proto_msgTypes, + }.Build() + File_envoy_extensions_access_loggers_stream_v3_stream_proto = out.File + file_envoy_extensions_access_loggers_stream_v3_stream_proto_rawDesc = nil + file_envoy_extensions_access_loggers_stream_v3_stream_proto_goTypes = nil + file_envoy_extensions_access_loggers_stream_v3_stream_proto_depIdxs = nil +} diff --git a/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/access_loggers/stream/v3/stream.pb.validate.go b/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/access_loggers/stream/v3/stream.pb.validate.go new file mode 100644 index 00000000..d47a7299 --- /dev/null +++ b/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/access_loggers/stream/v3/stream.pb.validate.go @@ -0,0 +1,350 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: envoy/extensions/access_loggers/stream/v3/stream.proto + +package streamv3 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "sort" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} + _ = sort.Sort +) + +// Validate checks the field values on StdoutAccessLog with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *StdoutAccessLog) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on StdoutAccessLog with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// StdoutAccessLogMultiError, or nil if none found. +func (m *StdoutAccessLog) ValidateAll() error { + return m.validate(true) +} + +func (m *StdoutAccessLog) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + switch v := m.AccessLogFormat.(type) { + case *StdoutAccessLog_LogFormat: + if v == nil { + err := StdoutAccessLogValidationError{ + field: "AccessLogFormat", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + + if m.GetLogFormat() == nil { + err := StdoutAccessLogValidationError{ + field: "LogFormat", + reason: "value is required", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetLogFormat()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, StdoutAccessLogValidationError{ + field: "LogFormat", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, StdoutAccessLogValidationError{ + field: "LogFormat", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetLogFormat()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return StdoutAccessLogValidationError{ + field: "LogFormat", + reason: "embedded message failed validation", + cause: err, + } + } + } + + default: + _ = v // ensures v is used + } + + if len(errors) > 0 { + return StdoutAccessLogMultiError(errors) + } + + return nil +} + +// StdoutAccessLogMultiError is an error wrapping multiple validation errors +// returned by StdoutAccessLog.ValidateAll() if the designated constraints +// aren't met. +type StdoutAccessLogMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m StdoutAccessLogMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m StdoutAccessLogMultiError) AllErrors() []error { return m } + +// StdoutAccessLogValidationError is the validation error returned by +// StdoutAccessLog.Validate if the designated constraints aren't met. +type StdoutAccessLogValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e StdoutAccessLogValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e StdoutAccessLogValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e StdoutAccessLogValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e StdoutAccessLogValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e StdoutAccessLogValidationError) ErrorName() string { return "StdoutAccessLogValidationError" } + +// Error satisfies the builtin error interface +func (e StdoutAccessLogValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sStdoutAccessLog.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = StdoutAccessLogValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = StdoutAccessLogValidationError{} + +// Validate checks the field values on StderrAccessLog with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *StderrAccessLog) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on StderrAccessLog with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// StderrAccessLogMultiError, or nil if none found. +func (m *StderrAccessLog) ValidateAll() error { + return m.validate(true) +} + +func (m *StderrAccessLog) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + switch v := m.AccessLogFormat.(type) { + case *StderrAccessLog_LogFormat: + if v == nil { + err := StderrAccessLogValidationError{ + field: "AccessLogFormat", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + + if m.GetLogFormat() == nil { + err := StderrAccessLogValidationError{ + field: "LogFormat", + reason: "value is required", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetLogFormat()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, StderrAccessLogValidationError{ + field: "LogFormat", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, StderrAccessLogValidationError{ + field: "LogFormat", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetLogFormat()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return StderrAccessLogValidationError{ + field: "LogFormat", + reason: "embedded message failed validation", + cause: err, + } + } + } + + default: + _ = v // ensures v is used + } + + if len(errors) > 0 { + return StderrAccessLogMultiError(errors) + } + + return nil +} + +// StderrAccessLogMultiError is an error wrapping multiple validation errors +// returned by StderrAccessLog.ValidateAll() if the designated constraints +// aren't met. +type StderrAccessLogMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m StderrAccessLogMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m StderrAccessLogMultiError) AllErrors() []error { return m } + +// StderrAccessLogValidationError is the validation error returned by +// StderrAccessLog.Validate if the designated constraints aren't met. +type StderrAccessLogValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e StderrAccessLogValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e StderrAccessLogValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e StderrAccessLogValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e StderrAccessLogValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e StderrAccessLogValidationError) ErrorName() string { return "StderrAccessLogValidationError" } + +// Error satisfies the builtin error interface +func (e StderrAccessLogValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sStderrAccessLog.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = StderrAccessLogValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = StderrAccessLogValidationError{} diff --git a/vendor/modules.txt b/vendor/modules.txt index 5e914cfc..b50e711c 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -36,7 +36,7 @@ github.com/envoyproxy/go-control-plane/envoy/config/overload/v3 github.com/envoyproxy/go-control-plane/envoy/config/route/v3 github.com/envoyproxy/go-control-plane/envoy/config/trace/v3 github.com/envoyproxy/go-control-plane/envoy/data/accesslog/v3 -github.com/envoyproxy/go-control-plane/envoy/extensions/access_loggers/file/v3 +github.com/envoyproxy/go-control-plane/envoy/extensions/access_loggers/stream/v3 github.com/envoyproxy/go-control-plane/envoy/extensions/clusters/aggregate/v3 github.com/envoyproxy/go-control-plane/envoy/extensions/filters/network/tcp_proxy/v3 github.com/envoyproxy/go-control-plane/envoy/extensions/filters/udp/udp_proxy/v3