...

Source file src/github.com/emissary-ingress/emissary/v3/pkg/api/getambassador.io/v3alpha1/crd_logservice.go

Documentation: github.com/emissary-ingress/emissary/v3/pkg/api/getambassador.io/v3alpha1

     1  // Copyright 2020 Datawire.  All rights reserved
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  ///////////////////////////////////////////////////////////////////////////
    16  // Important: Run "make generate-fast" to regenerate code after modifying
    17  // this file.
    18  ///////////////////////////////////////////////////////////////////////////
    19  
    20  package v3alpha1
    21  
    22  import (
    23  	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
    24  )
    25  
    26  type AdditionalLogHeaders struct {
    27  	HeaderName     string `json:"header_name,omitempty"`
    28  	DuringRequest  *bool  `json:"during_request,omitempty"`
    29  	DuringResponse *bool  `json:"during_response,omitempty"`
    30  	DuringTrailer  *bool  `json:"during_trailer,omitempty"`
    31  }
    32  
    33  type DriverConfig struct {
    34  	AdditionalLogHeaders []*AdditionalLogHeaders `json:"additional_log_headers,omitempty"`
    35  }
    36  
    37  // LogServiceSpec defines the desired state of LogService
    38  type LogServiceSpec struct {
    39  	AmbassadorID AmbassadorID `json:"ambassador_id,omitempty"`
    40  
    41  	Service string `json:"service,omitempty"`
    42  
    43  	// ProtocolVersion is the envoy api transport protocol version
    44  	//
    45  	// +kubebuilder:validation:Enum={"v2","v3"}
    46  	ProtocolVersion string `json:"protocol_version,omitempty"`
    47  
    48  	// +kubebuilder:validation:Enum={"tcp","http"}
    49  	Driver                string          `json:"driver,omitempty"`
    50  	DriverConfig          *DriverConfig   `json:"driver_config,omitempty"`
    51  	FlushIntervalTime     *SecondDuration `json:"flush_interval_time,omitempty"`
    52  	FlushIntervalByteSize *int            `json:"flush_interval_byte_size,omitempty"`
    53  
    54  	// TODO(lukeshu): In v3alpha2, drop this LogService.spec.grpc.  Due to sloppy implementation
    55  	// it is required to be present, and required to be 'true'.  It is silly to have a required
    56  	// field with only one valid value, we should just remove the thing.
    57  	GRPC *bool `json:"grpc,omitempty"`
    58  
    59  	StatsName string `json:"stats_name,omitempty"`
    60  }
    61  
    62  // LogService is the Schema for the logservices API
    63  //
    64  // +kubebuilder:object:root=true
    65  type LogService struct {
    66  	metav1.TypeMeta   `json:""`
    67  	metav1.ObjectMeta `json:"metadata,omitempty"`
    68  
    69  	Spec LogServiceSpec `json:"spec,omitempty"`
    70  }
    71  
    72  // LogServiceList contains a list of LogServices.
    73  //
    74  // +kubebuilder:object:root=true
    75  type LogServiceList struct {
    76  	metav1.TypeMeta `json:""`
    77  	metav1.ListMeta `json:"metadata,omitempty"`
    78  	Items           []LogService `json:"items"`
    79  }
    80  
    81  func init() {
    82  	SchemeBuilder.Register(&LogService{}, &LogServiceList{})
    83  }
    84  

View as plain text