routecfg

package
v1.1.0-rc.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 16, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package routecfg contains types for the gateway route

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessControlLists

type AccessControlLists struct {
	Blacklist []string `json:"blacklist,omitempty"`
	Whitelist []string `json:"whitelist,omitempty"`
}

AccessControlLists is the access control lists configuration

type Certificate

type Certificate struct {
	CertChain  string `json:"CertChain"`
	PrivateKey string `json:"PrivateKey"`
	IssuingCA  string `json:"IssuingCA,omitempty"`
}

Certificate is the certificate configuration

type Chains

type Chains struct {
	HTTPRoute      []string `json:"HTTPRoute"`
	HTTPSRoute     []string `json:"HTTPSRoute"`
	TLSPassthrough []string `json:"TLSPassthrough"`
	TLSTerminate   []string `json:"TLSTerminate"`
	TCPRoute       []string `json:"TCPRoute"`
}

Chains is the chains configuration

type CircuitBreaker

type CircuitBreaker struct {
	MinRequestAmount        int     `json:"MinRequestAmount"`
	StatTimeWindow          int     `json:"StatTimeWindow"`
	SlowTimeThreshold       float64 `json:"SlowTimeThreshold"`
	SlowAmountThreshold     int     `json:"SlowAmountThreshold"`
	SlowRatioThreshold      float64 `json:"SlowRatioThreshold"`
	ErrorAmountThreshold    int     `json:"ErrorAmountThreshold"`
	ErrorRatioThreshold     float64 `json:"ErrorRatioThreshold"`
	DegradedTimeWindow      int     `json:"DegradedTimeWindow"`
	DegradedStatusCode      int     `json:"DegradedStatusCode"`
	DegradedResponseContent string  `json:"DegradedResponseContent"`
}

CircuitBreaker is the circuit breaker configuration

type ConfigSpec

type ConfigSpec struct {
	Defaults    Defaults                 `json:"Configs"`
	Listeners   []Listener               `json:"Listeners" hash:"set"`
	Certificate *Certificate             `json:"Certificate,omitempty"`
	RouteRules  map[int32]RouteRule      `json:"RouteRules"`
	Services    map[string]ServiceConfig `json:"Services"`
	Chains      Chains                   `json:"Chains"`
	Features    Features                 `json:"Features"`
	Version     string                   `json:"Version" hash:"ignore"`
}

ConfigSpec is the configuration spec for the gateway

type ConnectionSettings

type ConnectionSettings struct {
	TCP  *TCPConnectionSettings  `json:"tcp,omitempty"`
	HTTP *HTTPConnectionSettings `json:"http,omitempty"`
}

ConnectionSettings is the connection settings configuration

type Defaults

type Defaults struct {
	EnableDebug                    bool   `json:"EnableDebug"`
	DefaultPassthroughUpstreamPort uint32 `json:"DefaultPassthroughUpstreamPort"`
}

Defaults is the default configuration

type Endpoint

type Endpoint struct {
	Weight       int               `json:"Weight"`
	Tags         map[string]string `json:"Tags,omitempty"`
	MTLS         bool              `json:"mTLS,omitempty"`
	UpstreamCert *UpstreamCert     `json:"UpstreamCert,omitempty"`
}

Endpoint is the endpoint configuration

type Features

type Features struct {
	Logging struct{} `json:"Logging"`
	Tracing struct{} `json:"Tracing"`
	Metrics struct{} `json:"Metrics"`
}

Features is the features configuration

type Filter

type Filter interface{}

Filter is the filter configuration

type GRPCMethod

type GRPCMethod struct {
	MatchType MatchType `json:"Type"`
	Service   *string   `json:"Service,omitempty"`
	Method    *string   `json:"Method,omitempty"`
}

GRPCMethod is the GRPC method configuration

type GRPCRouteRuleSpec

type GRPCRouteRuleSpec struct {
	RouteType L7RouteType        `json:"RouteType"`
	Matches   []GRPCTrafficMatch `json:"Matches" hash:"set"`
}

GRPCRouteRuleSpec is the GRPC route rule configuration

type GRPCTrafficMatch

type GRPCTrafficMatch struct {
	Headers        map[MatchType]map[string]string `json:"Headers,omitempty"`
	Method         *GRPCMethod                     `json:"Method,omitempty"`
	BackendService map[string]int32                `json:"BackendService"`
}

GRPCTrafficMatch is the GRPC traffic match configuration

type HTTPConnectionSettings

type HTTPConnectionSettings struct {
	MaxRequestsPerConnection int             `json:"MaxRequestsPerConnection"`
	MaxPendingRequests       int             `json:"MaxPendingRequests"`
	CircuitBreaker           *CircuitBreaker `json:"CircuitBreaker,omitempty"`
}

HTTPConnectionSettings is the HTTP connection settings configuration

type HTTPRouteRuleSpec

type HTTPRouteRuleSpec struct {
	RouteType L7RouteType        `json:"RouteType"`
	Matches   []HTTPTrafficMatch `json:"Matches" hash:"set"`
	RateLimit *RateLimit         `json:"RateLimit,omitempty"`
}

HTTPRouteRuleSpec is the HTTP route rule configuration

type HTTPTrafficMatch

type HTTPTrafficMatch struct {
	Path           *Path                           `json:"Path,omitempty"`
	Headers        map[MatchType]map[string]string `json:"Headers,omitempty"`
	RequestParams  map[MatchType]map[string]string `json:"RequestParams,omitempty"`
	Methods        []string                        `json:"Methods,omitempty" hash:"set"`
	BackendService map[string]int32                `json:"BackendService"`
	RateLimit      *RateLimit                      `json:"RateLimit,omitempty"`
}

HTTPTrafficMatch is the HTTP traffic match configuration

type L7RouteRule

type L7RouteRule map[string]L7RouteRuleSpec

L7RouteRule is the L7 route rule configuration

type L7RouteRuleSpec

type L7RouteRuleSpec interface{}

L7RouteRuleSpec is the L7 route rule configuration

type L7RouteType

type L7RouteType string

L7RouteType is the type of route

const (
	// L7RouteTypeHTTP is the HTTP route type
	L7RouteTypeHTTP L7RouteType = "HTTP"

	// L7RouteTypeGRPC is the GRPC route type
	L7RouteTypeGRPC L7RouteType = "GRPC"
)

type Listener

type Listener struct {
	Protocol           gwv1beta1.ProtocolType `json:"Protocol"`
	Port               gwv1beta1.PortNumber   `json:"Port"`
	Listen             gwv1beta1.PortNumber   `json:"Listen"`
	TLS                *TLS                   `json:"TLS,omitempty"`
	AccessControlLists *AccessControlLists    `json:"AccessControlLists,omitempty"`
	BpsLimit           *int64                 `json:"bpsLimit,omitempty"`
}

Listener is the listener configuration

type MatchType

type MatchType string

MatchType is the type of match

const (
	// MatchTypeExact is the exact match type
	MatchTypeExact MatchType = "Exact"

	// MatchTypePrefix is the prefix match type
	MatchTypePrefix MatchType = "Prefix"

	// MatchTypeRegex is the regex match type
	MatchTypeRegex MatchType = "Regex"
)

type PassthroughRouteMapping

type PassthroughRouteMapping map[string]string

PassthroughRouteMapping is the passthrough route mapping configuration

type Path

type Path struct {
	MatchType MatchType `json:"Type"`
	Path      string    `json:"Path"`
}

Path is the path configuration

type RateLimit

type RateLimit struct {
	Backlog              int               `json:"Backlog"`
	Requests             int               `json:"Requests"`
	Burst                int               `json:"Burst"`
	StatTimeWindow       int               `json:"StatTimeWindow"`
	ResponseStatusCode   int               `json:"ResponseStatusCode"`
	ResponseHeadersToAdd map[string]string `json:"ResponseHeadersToAdd,omitempty" hash:"set"`
}

RateLimit is the rate limit configuration

type RetryPolicy

type RetryPolicy struct {
	RetryOn                  string `json:"RetryOn"`
	PerTryTimeout            int    `json:"PerTryTimeout"`
	NumRetries               int    `json:"NumRetries"`
	RetryBackoffBaseInterval int    `json:"RetryBackoffBaseInterval"`
}

RetryPolicy is the retry policy configuration

type RouteRule

type RouteRule interface{}

RouteRule is the route rule configuration

type ServiceConfig

type ServiceConfig struct {
	Endpoints          map[string]Endpoint   `json:"Endpoints"`
	Filters            []Filter              `json:"Filters,omitempty" hash:"set"`
	ConnectionSettings *ConnectionSettings   `json:"ConnectionSettings,omitempty"`
	RetryPolicy        *RetryPolicy          `json:"RetryPolicy,omitempty"`
	MTLS               bool                  `json:"mTLS,omitempty"`
	UpstreamCert       *UpstreamCert         `json:"UpstreamCert,omitempty"`
	SessionSticky      bool                  `json:"SessionSticky,omitempty"`
	LoadBalancer       *commons.AlgoBalancer `json:"LoadBalancer,omitempty"`
}

ServiceConfig is the service configuration

type ServicePortName

type ServicePortName struct {
	types.NamespacedName
	Port *int32
}

ServicePortName is a combination of a service name, namespace, and port

func (*ServicePortName) String

func (spn *ServicePortName) String() string

type TCPConnectionSettings

type TCPConnectionSettings struct {
	MaxConnections int `json:"MaxConnections"`
}

TCPConnectionSettings is the TCP connection settings configuration

type TCPRouteRule

type TCPRouteRule map[string]int32

TCPRouteRule is the TCP route rule configuration

type TLS

type TLS struct {
	TLSModeType  gwv1beta1.TLSModeType `json:"TLSModeType"`
	MTLS         bool                  `json:"mTLS,omitempty"`
	Certificates []Certificate         `json:"Certificates,omitempty"`
}

TLS is the TLS configuration

type TLSBackendService

type TLSBackendService map[string]int32

TLSBackendService is the TLS backend service configuration

type TLSPassthroughRouteRule

type TLSPassthroughRouteRule map[string]string

TLSPassthroughRouteRule is the TLS passthrough route rule configuration

type TLSTerminateRouteRule

type TLSTerminateRouteRule map[string]TLSBackendService

TLSTerminateRouteRule is the TLS terminate route rule configuration

type UDPRouteRule

type UDPRouteRule map[string]int32

UDPRouteRule is the UDP route rule configuration

type UpstreamCert

type UpstreamCert Certificate

UpstreamCert is the upstream certificate configuration

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL