ir

package
v0.2.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultProxyName  = "default"
	DefaultProxyImage = "envoyproxy/envoy-dev:latest"
)

Variables

View Source
var (
	ErrHTTPListenerNameEmpty       = errors.New("field Name must be specified")
	ErrHTTPListenerAddressInvalid  = errors.New("field Address must be a valid IP address")
	ErrHTTPListenerPortInvalid     = errors.New("field Port specified is invalid")
	ErrHTTPListenerHostnamesEmpty  = errors.New("field Hostnames must be specified with at least a single hostname entry")
	ErrTLSServerCertEmpty          = errors.New("field ServerCertificate must be specified")
	ErrTLSPrivateKey               = errors.New("field PrivateKey must be specified")
	ErrHTTPRouteNameEmpty          = errors.New("field Name must be specified")
	ErrHTTPRouteMatchEmpty         = errors.New("either PathMatch, HeaderMatches or QueryParamMatches fields must be specified")
	ErrRouteDestinationHostInvalid = errors.New("field Address must be a valid IP address")
	ErrRouteDestinationPortInvalid = errors.New("field Port specified is invalid")
	ErrStringMatchConditionInvalid = errors.New("only one of the Exact, Prefix or SafeRegex fields must be specified")
)

Functions

This section is empty.

Types

type HTTPListener

type HTTPListener struct {
	// Name of the HttpListener
	Name string
	// Address that the listener should listen on.
	Address string
	// Port on which the service can be expected to be accessed by clients.
	Port uint32
	// Hostnames (Host/Authority header value) with which the service can be expected to be accessed by clients.
	// This field is required. Wildcard hosts are supported in the suffix or prefix form.
	// Refer to https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/route/v3/route_components.proto#config-route-v3-virtualhost
	// for more info.
	Hostnames []string
	// Tls certificate info. If omitted, the gateway will expose a plain text HTTP server.
	TLS *TLSListenerConfig
	// Routes associated with HTTP traffic to the service.
	Routes []*HTTPRoute
}

HTTPListener holds the listener configuration. +k8s:deepcopy-gen=true

func (*HTTPListener) DeepCopy

func (in *HTTPListener) DeepCopy() *HTTPListener

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPListener.

func (*HTTPListener) DeepCopyInto

func (in *HTTPListener) DeepCopyInto(out *HTTPListener)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (HTTPListener) Validate

func (h HTTPListener) Validate() error

Validate the fields within the HTTPListener structure

type HTTPRoute

type HTTPRoute struct {
	// Name of the HTTPRoute
	Name string
	// PathMatch defines the match conditions on the path.
	PathMatch *StringMatch
	// HeaderMatches define the match conditions on the request headers for this route.
	HeaderMatches []*StringMatch
	// QueryParamMatches define the match conditions on the query parameters.
	QueryParamMatches []*StringMatch
	// Destinations associated with this matched route.
	Destinations []*RouteDestination
}

HTTPRoute holds the route information associated with the HTTP Route +k8s:deepcopy-gen=true

func (*HTTPRoute) DeepCopy

func (in *HTTPRoute) DeepCopy() *HTTPRoute

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPRoute.

func (*HTTPRoute) DeepCopyInto

func (in *HTTPRoute) DeepCopyInto(out *HTTPRoute)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (HTTPRoute) Validate

func (h HTTPRoute) Validate() error

Validate the fields within the HTTPRoute structure

type Infra

type Infra struct {
	// Proxy defines managed proxy infrastructure.
	Proxy *ProxyInfra
}

Infra defines managed infrastructure. +k8s:deepcopy-gen=true

func NewInfra

func NewInfra() *Infra

NewInfra returns a new Infra with default parameters.

func (*Infra) DeepCopy

func (in *Infra) DeepCopy() *Infra

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Infra.

func (*Infra) DeepCopyInto

func (in *Infra) DeepCopyInto(out *Infra)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Infra) GetProxyInfra

func (i *Infra) GetProxyInfra() *ProxyInfra

GetProxyInfra returns the ProxyInfra.

func (*Infra) Validate

func (i *Infra) Validate() error

Validate validates the provided Infra.

type ListenerPort

type ListenerPort struct {
	// Name is the name of the listener port.
	Name string
	// Protocol is the protocol that the listener port will listener for.
	Protocol ProtocolType
	// Port is the port number to listen on.
	Port int32
}

ListenerPort defines a network port of a listener. +k8s:deepcopy-gen=true

func (*ListenerPort) DeepCopy

func (in *ListenerPort) DeepCopy() *ListenerPort

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ListenerPort.

func (*ListenerPort) DeepCopyInto

func (in *ListenerPort) DeepCopyInto(out *ListenerPort)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ProtocolType

type ProtocolType string

ProtocolType defines the application protocol accepted by a ListenerPort.

Valid values include "HTTP" and "HTTPS".

const (
	// HTTPProtocolType accepts cleartext HTTP/1.1 sessions over TCP or HTTP/2
	// over cleartext.
	HTTPProtocolType ProtocolType = "HTTP"

	// HTTPSProtocolType accepts HTTP/1.1 or HTTP/2 sessions over TLS.
	HTTPSProtocolType ProtocolType = "HTTPS"
)

type ProxyInfra

type ProxyInfra struct {
	// TODO: Figure out how to represent metadata in the IR.
	// xref: https://github.com/envoyproxy/gateway/issues/173
	//
	// Name is the name used for managed proxy infrastructure.
	Name string
	// Config defines user-facing configuration of the managed proxy infrastructure.
	Config *v1alpha1.EnvoyProxy
	// Image is the container image used for the managed proxy infrastructure.
	// If unset, defaults to "envoyproxy/envoy-dev:latest".
	Image string
	// Listeners define the listeners exposed by the proxy infrastructure.
	Listeners []ProxyListener
}

ProxyInfra defines managed proxy infrastructure. +k8s:deepcopy-gen=true

func NewProxyInfra

func NewProxyInfra() *ProxyInfra

NewProxyInfra returns a new ProxyInfra with default parameters.

func (*ProxyInfra) DeepCopy

func (in *ProxyInfra) DeepCopy() *ProxyInfra

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProxyInfra.

func (*ProxyInfra) DeepCopyInto

func (in *ProxyInfra) DeepCopyInto(out *ProxyInfra)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ProxyInfra) ObjectName

func (p *ProxyInfra) ObjectName() string

ObjectName returns the name of the proxy infrastructure object.

func (*ProxyInfra) Validate

func (p *ProxyInfra) Validate() error

Validate validates the provided ProxyInfra.

type ProxyListener

type ProxyListener struct {
	// Address is the address that the listener should listen on.
	Address string
	// Ports define network ports of the listener.
	Ports []ListenerPort
}

ProxyListener defines the listener configuration of the proxy infrastructure. +k8s:deepcopy-gen=true

func NewProxyListeners

func NewProxyListeners() []ProxyListener

NewProxyListeners returns a new slice of ProxyListener with default parameters.

func (*ProxyListener) DeepCopy

func (in *ProxyListener) DeepCopy() *ProxyListener

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProxyListener.

func (*ProxyListener) DeepCopyInto

func (in *ProxyListener) DeepCopyInto(out *ProxyListener)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RouteDestination

type RouteDestination struct {
	// Host refers to the FQDN or IP address of the backend service.
	Host string
	// Port on the service to forward the request to.
	Port uint32
	// Weight associated with this destination.
	Weight uint32
}

RouteDestination holds the destination details associated with the route

func (RouteDestination) Validate

func (r RouteDestination) Validate() error

Validate the fields within the RouteDestination structure

type StringMatch

type StringMatch struct {
	// Name of the field to match on.
	Name string
	// Exact match condition.
	Exact *string
	// Prefix match condition.
	Prefix *string
	// SafeRegex match condition.
	SafeRegex *string
}

StringMatch holds the various match conditions. Only one of Exact, Prefix or SafeRegex can be set. +k8s:deepcopy-gen=true

func (*StringMatch) DeepCopy

func (in *StringMatch) DeepCopy() *StringMatch

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StringMatch.

func (*StringMatch) DeepCopyInto

func (in *StringMatch) DeepCopyInto(out *StringMatch)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (StringMatch) Validate

func (s StringMatch) Validate() error

Validate the fields within the StringMatch structure

type TLSListenerConfig

type TLSListenerConfig struct {
	// ServerCertificate of the server.
	ServerCertificate []byte
	// PrivateKey for the server.
	PrivateKey []byte
}

TLSListenerConfig holds the configuration for downstream TLS context. +k8s:deepcopy-gen=true

func (*TLSListenerConfig) DeepCopy

func (in *TLSListenerConfig) DeepCopy() *TLSListenerConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TLSListenerConfig.

func (*TLSListenerConfig) DeepCopyInto

func (in *TLSListenerConfig) DeepCopyInto(out *TLSListenerConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (TLSListenerConfig) Validate

func (t TLSListenerConfig) Validate() error

Validate the fields within the TLSListenerConfig structure

type Xds

type Xds struct {
	// HTTP listeners exposed by the gateway.
	HTTP []*HTTPListener
}

Xds holds the intermediate representation of a Gateway and is used by the xDS Translator to convert it into xDS resources. +k8s:deepcopy-gen=true

func (*Xds) DeepCopy

func (in *Xds) DeepCopy() *Xds

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Xds.

func (*Xds) DeepCopyInto

func (in *Xds) DeepCopyInto(out *Xds)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (Xds) GetListener

func (x Xds) GetListener(name string) *HTTPListener

func (Xds) Validate

func (x Xds) Validate() error

Validate the fields within the Xds structure.

Jump to

Keyboard shortcuts

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