...

Source file src/github.com/datawire/ambassador/v2/pkg/api/getambassador.io/v3alpha1/crd_tcpmapping.go

Documentation: github.com/datawire/ambassador/v2/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  // TCPMappingSpec defines the desired state of TCPMapping
    27  type TCPMappingSpec struct {
    28  	AmbassadorID AmbassadorID `json:"ambassador_id,omitempty"`
    29  
    30  	// Port isn't a pointer because it's required.
    31  	// +kubebuilder:validation:Required
    32  	Port    int    `json:"port,omitempty"`
    33  	Host    string `json:"host,omitempty"`
    34  	Address string `json:"address,omitempty"`
    35  	// +kubebuilder:validation:Required
    36  	Service         string           `json:"service,omitempty"`
    37  	EnableIPv4      *bool            `json:"enable_ipv4,omitempty"`
    38  	EnableIPv6      *bool            `json:"enable_ipv6,omitempty"`
    39  	CircuitBreakers []CircuitBreaker `json:"circuit_breakers,omitempty"`
    40  
    41  	// FIXME(lukeshu): Surely this should be an 'int'?
    42  	IdleTimeoutMs string `json:"idle_timeout_ms,omitempty"`
    43  
    44  	Resolver   string `json:"resolver,omitempty"`
    45  	TLS        string `json:"tls,omitempty"`
    46  	Weight     *int   `json:"weight,omitempty"`
    47  	ClusterTag string `json:"cluster_tag,omitempty"`
    48  	StatsName  string `json:"stats_name,omitempty"`
    49  
    50  	V2ExplicitTLS *V2ExplicitTLS `json:"v2ExplicitTLS,omitempty"`
    51  }
    52  
    53  // TCPMapping is the Schema for the tcpmappings API
    54  //
    55  // +kubebuilder:object:root=true
    56  type TCPMapping struct {
    57  	metav1.TypeMeta   `json:""`
    58  	metav1.ObjectMeta `json:"metadata,omitempty"`
    59  
    60  	Spec TCPMappingSpec `json:"spec,omitempty"`
    61  }
    62  
    63  // TCPMappingList contains a list of TCPMappings.
    64  //
    65  // +kubebuilder:object:root=true
    66  type TCPMappingList struct {
    67  	metav1.TypeMeta `json:""`
    68  	metav1.ListMeta `json:"metadata,omitempty"`
    69  	Items           []TCPMapping `json:"items"`
    70  }
    71  
    72  func init() {
    73  	SchemeBuilder.Register(&TCPMapping{}, &TCPMappingList{})
    74  }
    75  

View as plain text