builder

package
v3.2.1 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAllowedRoutesFromAllNamespaces

func NewAllowedRoutesFromAllNamespaces() *gatewayapi.AllowedRoutes

func NewAllowedRoutesFromSameNamespaces

func NewAllowedRoutesFromSameNamespaces() *gatewayapi.AllowedRoutes

func NewAllowedRoutesFromSelectorNamespace

func NewAllowedRoutesFromSelectorNamespace(selector *metav1.LabelSelector) *gatewayapi.AllowedRoutes

Types

type BackendRefBuilder

type BackendRefBuilder struct {
	// contains filtered or unexported fields
}

BackendRefBuilder is a builder for gateway api BackendRef. Will set default values, as specified in the gateway API, for fields that are not set. Primarily used for testing.

func NewBackendRef

func NewBackendRef(name string) *BackendRefBuilder

func (*BackendRefBuilder) Build

func (*BackendRefBuilder) ToSlice

func (b *BackendRefBuilder) ToSlice() []gatewayapi.BackendRef

func (*BackendRefBuilder) WithGroup

func (b *BackendRefBuilder) WithGroup(group string) *BackendRefBuilder

func (*BackendRefBuilder) WithKind

func (b *BackendRefBuilder) WithKind(kind string) *BackendRefBuilder

func (*BackendRefBuilder) WithNamespace

func (b *BackendRefBuilder) WithNamespace(namespace string) *BackendRefBuilder

func (*BackendRefBuilder) WithPort

func (b *BackendRefBuilder) WithPort(port int) *BackendRefBuilder

func (*BackendRefBuilder) WithWeight

func (b *BackendRefBuilder) WithWeight(weight int) *BackendRefBuilder

type EndpointPortBuilder

type EndpointPortBuilder struct {
	// contains filtered or unexported fields
}

EndpointPortBuilder is a builder for discovery v1 EndpointPort. Primarily used for testing.

func NewEndpointPort

func NewEndpointPort(port int32) *EndpointPortBuilder

func (*EndpointPortBuilder) Build

Build returns the configured EndpointPort.

func (*EndpointPortBuilder) IntoSlice

func (b *EndpointPortBuilder) IntoSlice() []discoveryv1.EndpointPort

IntoSlice returns the configured EndpointPort in a slice.

func (*EndpointPortBuilder) WithName

func (b *EndpointPortBuilder) WithName(name string) *EndpointPortBuilder

WithName sets the name on the endpoint port.

func (*EndpointPortBuilder) WithProtocol

func (b *EndpointPortBuilder) WithProtocol(proto corev1.Protocol) *EndpointPortBuilder

WithProtocol sets the protocol on the endpoint port.

type HTTPBackendRefBuilder

type HTTPBackendRefBuilder struct {
	// contains filtered or unexported fields
}

HTTPBackendRefBuilder is a builder for gateway api HTTPBackendRef. Will set default values, as specified in the gateway API, for fields that are not set. Primarily used for testing.

func NewHTTPBackendRef

func NewHTTPBackendRef(name string) *HTTPBackendRefBuilder

func (*HTTPBackendRefBuilder) Build

func (*HTTPBackendRefBuilder) ToSlice

func (*HTTPBackendRefBuilder) WithGroup

func (b *HTTPBackendRefBuilder) WithGroup(group string) *HTTPBackendRefBuilder

func (*HTTPBackendRefBuilder) WithKind

func (*HTTPBackendRefBuilder) WithNamespace

func (b *HTTPBackendRefBuilder) WithNamespace(namespace string) *HTTPBackendRefBuilder

func (*HTTPBackendRefBuilder) WithPort

func (b *HTTPBackendRefBuilder) WithPort(port int) *HTTPBackendRefBuilder

func (*HTTPBackendRefBuilder) WithWeight

func (b *HTTPBackendRefBuilder) WithWeight(weight int) *HTTPBackendRefBuilder

type HTTPRouteFilterBuilder

type HTTPRouteFilterBuilder struct {
	// contains filtered or unexported fields
}

HTTPRouteFilterBuilder is a builder for gateway api HTTPRouteMatch. Primarily used for testing.

func NewHTTPRouteRequestHeaderModifierFilter

func NewHTTPRouteRequestHeaderModifierFilter() *HTTPRouteFilterBuilder

NewHTTPRouteRequestHeaderModifierFilter builds a request header modifier HTTPRoute filter.

func NewHTTPRouteRequestRedirectFilter

func NewHTTPRouteRequestRedirectFilter() *HTTPRouteFilterBuilder

NewHTTPRouteRequestRedirectFilter builds a request redirect HTTPRoute filter.

func (*HTTPRouteFilterBuilder) Build

func (*HTTPRouteFilterBuilder) WithRequestHeaderAdd

func (b *HTTPRouteFilterBuilder) WithRequestHeaderAdd(headers []gatewayapi.HTTPHeader) *HTTPRouteFilterBuilder

func (*HTTPRouteFilterBuilder) WithRequestHeaderRemove

func (b *HTTPRouteFilterBuilder) WithRequestHeaderRemove(headerNames []string) *HTTPRouteFilterBuilder

func (*HTTPRouteFilterBuilder) WithRequestHeaderSet

func (b *HTTPRouteFilterBuilder) WithRequestHeaderSet(headers []gatewayapi.HTTPHeader) *HTTPRouteFilterBuilder

func (*HTTPRouteFilterBuilder) WithRequestRedirectHost

func (b *HTTPRouteFilterBuilder) WithRequestRedirectHost(host string) *HTTPRouteFilterBuilder

WithRequestRedirectHost sets host of request redirect filter.

func (*HTTPRouteFilterBuilder) WithRequestRedirectScheme

func (b *HTTPRouteFilterBuilder) WithRequestRedirectScheme(scheme string) *HTTPRouteFilterBuilder

WithRequestRedirectScheme sets scheme of request redirect filter.

func (*HTTPRouteFilterBuilder) WithRequestRedirectStatusCode

func (b *HTTPRouteFilterBuilder) WithRequestRedirectStatusCode(code int) *HTTPRouteFilterBuilder

WithRequestRedirectStatusCode sets status code of response in request redirect filter.

type HTTPRouteMatchBuilder

type HTTPRouteMatchBuilder struct {
	// contains filtered or unexported fields
}

HTTPRouteMatchBuilder is a builder for gateway api HTTPRouteMatch. Primarily used for testing. Please note that some methods are not provided yet, as we don't need them yet. Feel free to add them as needed.

func NewHTTPRouteMatch

func NewHTTPRouteMatch() *HTTPRouteMatchBuilder

func (*HTTPRouteMatchBuilder) Build

func (*HTTPRouteMatchBuilder) ToSlice

func (*HTTPRouteMatchBuilder) WithHeader

func (b *HTTPRouteMatchBuilder) WithHeader(name, value string) *HTTPRouteMatchBuilder

func (*HTTPRouteMatchBuilder) WithHeaderRegex

func (b *HTTPRouteMatchBuilder) WithHeaderRegex(name, value string) *HTTPRouteMatchBuilder

func (*HTTPRouteMatchBuilder) WithMethod

func (*HTTPRouteMatchBuilder) WithPathExact

func (b *HTTPRouteMatchBuilder) WithPathExact(pathRegexp string) *HTTPRouteMatchBuilder

func (*HTTPRouteMatchBuilder) WithPathPrefix

func (b *HTTPRouteMatchBuilder) WithPathPrefix(pathPrefix string) *HTTPRouteMatchBuilder

func (*HTTPRouteMatchBuilder) WithPathRegex

func (b *HTTPRouteMatchBuilder) WithPathRegex(pathRegexp string) *HTTPRouteMatchBuilder

func (*HTTPRouteMatchBuilder) WithPathType

func (b *HTTPRouteMatchBuilder) WithPathType(pathValuePtr *string, pathTypePtr *gatewayapi.PathMatchType) *HTTPRouteMatchBuilder

func (*HTTPRouteMatchBuilder) WithQueryParam

func (b *HTTPRouteMatchBuilder) WithQueryParam(name, value string) *HTTPRouteMatchBuilder

func (*HTTPRouteMatchBuilder) WithQueryParamRegex

func (b *HTTPRouteMatchBuilder) WithQueryParamRegex(name, value string) *HTTPRouteMatchBuilder

type IngressBuilder

type IngressBuilder struct {
	// contains filtered or unexported fields
}

func NewIngress

func NewIngress(name string, class string) *IngressBuilder

NewIngress builds an Ingress object with the given name and class, when "" is passed as class parameter the field .Spec.IngressClassName is not set.

func (*IngressBuilder) Build

func (b *IngressBuilder) Build() *netv1.Ingress

func (*IngressBuilder) WithAnnotations added in v3.1.0

func (b *IngressBuilder) WithAnnotations(annotations map[string]string) *IngressBuilder

func (*IngressBuilder) WithDefaultBackend added in v3.1.0

func (b *IngressBuilder) WithDefaultBackend(backend *netv1.IngressBackend) *IngressBuilder

func (*IngressBuilder) WithKongPlugins added in v3.2.0

func (b *IngressBuilder) WithKongPlugins(names ...string) *IngressBuilder

func (*IngressBuilder) WithLegacyClassAnnotation

func (b *IngressBuilder) WithLegacyClassAnnotation(class string) *IngressBuilder

func (*IngressBuilder) WithNamespace added in v3.1.0

func (b *IngressBuilder) WithNamespace(namespace string) *IngressBuilder

func (*IngressBuilder) WithRules

func (b *IngressBuilder) WithRules(rules ...netv1.IngressRule) *IngressBuilder

type KongstateServiceBackendBuilder

type KongstateServiceBackendBuilder struct {
	// contains filtered or unexported fields
}

KongstateServiceBackendBuilder is a builder for KongstateServiceBackend. Primarily used for testing.

func NewKongstateServiceBackend

func NewKongstateServiceBackend(name string) *KongstateServiceBackendBuilder

func (*KongstateServiceBackendBuilder) MustBuild added in v3.1.0

func (*KongstateServiceBackendBuilder) WithNamespace

func (*KongstateServiceBackendBuilder) WithPortName added in v3.1.0

func (*KongstateServiceBackendBuilder) WithPortNumber

func (*KongstateServiceBackendBuilder) WithType added in v3.1.0

func (*KongstateServiceBackendBuilder) WithWeight

type ListenerBuilder

type ListenerBuilder struct {
	// contains filtered or unexported fields
}

ListenerBuilder is a builder for gateway api Listener. Will set default values, as specified in the gateway API, for fields that are not set. Primarily used for testing.

func NewListener

func NewListener(name string) *ListenerBuilder

func (*ListenerBuilder) Build

func (b *ListenerBuilder) Build() gatewayapi.Listener

Build returns the configured Listener.

func (*ListenerBuilder) HTTP

func (b *ListenerBuilder) HTTP() *ListenerBuilder

func (*ListenerBuilder) HTTPS

func (b *ListenerBuilder) HTTPS() *ListenerBuilder

func (*ListenerBuilder) IntoSlice

func (b *ListenerBuilder) IntoSlice() []gatewayapi.Listener

IntoSlice returns the configured Listener in a slice.

func (*ListenerBuilder) TCP

func (b *ListenerBuilder) TCP() *ListenerBuilder

func (*ListenerBuilder) TLS

func (b *ListenerBuilder) TLS() *ListenerBuilder

func (*ListenerBuilder) UDP

func (b *ListenerBuilder) UDP() *ListenerBuilder

func (*ListenerBuilder) WithAllowedRoutes

func (b *ListenerBuilder) WithAllowedRoutes(routes *gatewayapi.AllowedRoutes) *ListenerBuilder

func (*ListenerBuilder) WithHostname

func (b *ListenerBuilder) WithHostname(hostname string) *ListenerBuilder

func (*ListenerBuilder) WithPort

func (b *ListenerBuilder) WithPort(port int) *ListenerBuilder

func (*ListenerBuilder) WithTLSConfig

func (b *ListenerBuilder) WithTLSConfig(tlsConfig *gatewayapi.GatewayTLSConfig) *ListenerBuilder

type RouteGroupKindBuilder

type RouteGroupKindBuilder struct {
	// contains filtered or unexported fields
}

RouteGroupKindBuilder is a builder for gateway api RouteGroupKind. Will set default values, as specified in the gateway API, for fields that are not set. Primarily used for testing.

func NewRouteGroupKind

func NewRouteGroupKind() *RouteGroupKindBuilder

func (*RouteGroupKindBuilder) Build

Build returns the configured RouteGroupKind.

func (*RouteGroupKindBuilder) GRPCRoute

func (*RouteGroupKindBuilder) HTTPRoute

func (*RouteGroupKindBuilder) IntoSlice

IntoSlice returns the configured RouteGroupKind in a slice.

func (*RouteGroupKindBuilder) TCPRoute

func (*RouteGroupKindBuilder) TLSRoute

func (*RouteGroupKindBuilder) UDPRoute

type RouteNamespacesBuilder

type RouteNamespacesBuilder struct {
	// contains filtered or unexported fields
}

RouteNamespacesBuilder is a builder for gateway api RouteNamespaces. Will set default values, as specified in the gateway API, for fields that are not set. Primarily used for testing.

func NewRouteNamespaces

func NewRouteNamespaces() *RouteNamespacesBuilder

func (*RouteNamespacesBuilder) Build

Build returns the configured RouteNamespaces.

func (*RouteNamespacesBuilder) FromAll

func (*RouteNamespacesBuilder) FromSame

func (*RouteNamespacesBuilder) FromSelector

type ServicePortBuilder

type ServicePortBuilder struct {
	// contains filtered or unexported fields
}

ServicePortBuilder is a builder for core v1 ServicePort. Primarily used for testing.

func NewServicePort

func NewServicePort() *ServicePortBuilder

func (*ServicePortBuilder) Build

Build returns the configured ServicePort.

func (*ServicePortBuilder) IntoSlice

func (b *ServicePortBuilder) IntoSlice() []corev1.ServicePort

IntoSlice returns the configured ServicePort in a slice.

func (*ServicePortBuilder) WithAppProtocol

func (b *ServicePortBuilder) WithAppProtocol(appproto string) *ServicePortBuilder

WithAppProtocol sets the app protocol on the service port.

func (*ServicePortBuilder) WithName

func (b *ServicePortBuilder) WithName(name string) *ServicePortBuilder

WithName sets the name on the service port.

func (*ServicePortBuilder) WithNodePort

func (b *ServicePortBuilder) WithNodePort(port int32) *ServicePortBuilder

WithNodePort sets the target port on the service port.

func (*ServicePortBuilder) WithPort

func (b *ServicePortBuilder) WithPort(port int32) *ServicePortBuilder

WithPort sets the port on the service port.

func (*ServicePortBuilder) WithProtocol

func (b *ServicePortBuilder) WithProtocol(proto corev1.Protocol) *ServicePortBuilder

WithProtocol sets the protocol on the service port.

func (*ServicePortBuilder) WithTargetPort

func (b *ServicePortBuilder) WithTargetPort(targetport intstr.IntOrString) *ServicePortBuilder

WithTargetPort sets the target port on the service port.

Jump to

Keyboard shortcuts

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