decorators

package
v0.10.7 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(constructor Constructor)

Types

type Constructor

type Constructor func(params Parameters) Decorator

type Decorator

type Decorator interface {
	// unique identifier for decorator
	DecoratorName() string
}

Decorators modify the output VirtualService corresponding to the input TrafficTarget.

type Factory

type Factory interface {
	// return a set of decorators built from the given snapshot.
	MakeDecorators(params Parameters) []Decorator
}

the decorator Factory initializes Translator decorators on each reconcile

func NewFactory

func NewFactory() Factory

type Parameters

type Parameters struct {
	ClusterDomains hostutils.ClusterDomainRegistry
	Snapshot       input.Snapshot
}

parameters for initializing decorators

type RegisterField

type RegisterField func(fieldPtr, val interface{}) error

type TrafficPolicyDestinationRuleDecorator

type TrafficPolicyDestinationRuleDecorator interface {
	Decorator

	ApplyTrafficPolicyToDestinationRule(
		appliedPolicy *discoveryv1alpha2.TrafficTargetStatus_AppliedTrafficPolicy,
		service *discoveryv1alpha2.TrafficTarget,
		output *networkingv1alpha3spec.DestinationRule,
		registerField RegisterField,
	) error
}

a TrafficPolicyDestinationRuleDecorator modifies the DestinationRule based on a TrafficPolicy which applies to the TrafficTarget.

type TrafficPolicyVirtualServiceDecorator

type TrafficPolicyVirtualServiceDecorator interface {
	Decorator

	ApplyTrafficPolicyToVirtualService(
		appliedPolicy *discoveryv1alpha2.TrafficTargetStatus_AppliedTrafficPolicy,
		trafficTarget *discoveryv1alpha2.TrafficTarget,
		sourceMeshInstallation *discoveryv1alpha2.MeshSpec_MeshInstallation,
		output *networkingv1alpha3spec.HTTPRoute,
		registerField RegisterField,
	) error
}

A TrafficPolicyVirtualServiceDecorator modifies the VirtualService based on a TrafficPolicy which applies to the TrafficTarget.

If sourceMeshInstallation is specified, hostnames in the translated VirtualService will use global FQDNs if the trafficTarget exists in a different cluster from the specified mesh (i.e. is a federated traffic target). Otherwise, assume translation for cluster that the trafficTarget exists in and use local FQDNs.

type VirtualTrafficTargetEntryDecorator

type VirtualTrafficTargetEntryDecorator interface {
	Decorator

	ApplyVirtualMeshToServiceEntry(
		appliedVirtualMesh *discoveryv1alpha2.MeshStatus_AppliedVirtualMesh,
		service *discoveryv1alpha2.TrafficTarget,
		output *networkingv1alpha3spec.ServiceEntry,
		registerField RegisterField,
	) error
}

a VirtualTrafficTargetEntryDecorator modifies the ServiceEntry based on a VirtualMesh which applies to the TrafficTarget.

Directories

Path Synopsis
Package mock_decorators is a generated GoMock package.
Package mock_decorators is a generated GoMock package.

Jump to

Keyboard shortcuts

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