decorators

package
v1.1.0-beta1 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2021 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 Destination.

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.LocalSnapshot
}

parameters for initializing decorators

type RegisterField

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

type TrafficPolicyDestinationRuleDecorator

type TrafficPolicyDestinationRuleDecorator interface {
	Decorator

	ApplyTrafficPolicyToDestinationRule(
		appliedPolicy *discoveryv1.DestinationStatus_AppliedTrafficPolicy,
		service *discoveryv1.Destination,
		output *networkingv1alpha3spec.DestinationRule,
		registerField RegisterField,
	) error
}

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

type TrafficPolicyVirtualServiceDecorator

type TrafficPolicyVirtualServiceDecorator interface {
	Decorator

	ApplyTrafficPolicyToVirtualService(
		appliedPolicy *discoveryv1.DestinationStatus_AppliedTrafficPolicy,
		destination *discoveryv1.Destination,
		sourceMeshInstallation *discoveryv1.MeshSpec_MeshInstallation,
		output *networkingv1alpha3spec.HTTPRoute,
		registerField RegisterField,
	) error
}

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

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

type VirtualDestinationEntryDecorator added in v1.0.0

type VirtualDestinationEntryDecorator interface {
	Decorator

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

a VirtualDestinationEntryDecorator modifies the ServiceEntry based on a VirtualMesh which applies to the Destination.

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