mesh

package
v0.0.0-...-314e46e Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2025 License: Apache-2.0 Imports: 15 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyMeshConfig

func ApplyMeshConfig(yaml string, defaultConfig *meshconfig.MeshConfig) (*meshconfig.MeshConfig, error)

ApplyMeshConfig returns a new MeshConfig decoded from the input YAML with the provided defaults applied to omitted configuration values.

func ApplyMeshConfigDefaults

func ApplyMeshConfigDefaults(yaml string) (*meshconfig.MeshConfig, error)

ApplyMeshConfigDefaults returns a new MeshConfig decoded from the input YAML with defaults applied to omitted configuration values.

func ApplyProxyConfig

func ApplyProxyConfig(yaml string, meshConfig *meshconfig.MeshConfig) (*meshconfig.MeshConfig, error)

ApplyProxyConfig applies the give proxy config yaml to a mesh config object. The passed in mesh config will not be modified.

func DeepCopyMeshConfig

func DeepCopyMeshConfig(mc *meshconfig.MeshConfig) (*meshconfig.MeshConfig, error)

func DefaultMeshConfig

func DefaultMeshConfig() *meshconfig.MeshConfig

DefaultMeshConfig returns the default mesh config. This is merged with values from the mesh config map.

func DefaultMeshNetworks

func DefaultMeshNetworks() *meshconfig.MeshNetworks

DefaultMeshNetworks returns a default meshnetworks configuration. By default, it is empty.

func DefaultProxyConfig

func DefaultProxyConfig() *meshconfig.ProxyConfig

DefaultProxyConfig for individual proxies

func EmptyMeshNetworks

func EmptyMeshNetworks() meshconfig.MeshNetworks

EmptyMeshNetworks configuration with no networks

func MergeProxyConfig

func MergeProxyConfig(yaml string, proxyConfig *meshconfig.ProxyConfig) (*meshconfig.ProxyConfig, error)

MergeProxyConfig merges the given proxy config yaml with the given proxy config object.

func ParseMeshNetworks

func ParseMeshNetworks(yaml string) (*meshconfig.MeshNetworks, error)

ParseMeshNetworks returns a new MeshNetworks decoded from the input YAML.

func ReadMeshConfig

func ReadMeshConfig(filename string) (*meshconfig.MeshConfig, error)

ReadMeshConfig gets mesh configuration from a config file

func ReadMeshConfigData

func ReadMeshConfigData(filename string) (string, error)

ReadMeshConfigData gets mesh configuration yaml from a config file

func ReadMeshNetworks

func ReadMeshNetworks(filename string) (*meshconfig.MeshNetworks, error)

ReadMeshNetworks gets mesh networks configuration from a config file

Types

type Holder

type Holder interface {
	Mesh() *v1alpha1.MeshConfig
}

Holder of a mesh configuration.

type NetworksWatcher

type NetworksWatcher interface {
	Networks() *v1alpha1.MeshNetworks

	// AddNetworksHandler registers a callback handler for changes to the networks config.
	AddNetworksHandler(func()) *WatcherHandlerRegistration

	// DeleteNetworksHandler unregisters a callback handler when remote cluster is removed.
	DeleteNetworksHandler(registration *WatcherHandlerRegistration)
}

NetworksWatcher watches changes to the mesh networks config.

type Watcher

type Watcher interface {
	Holder

	// AddMeshHandler registers a callback handler for changes to the mesh config.
	AddMeshHandler(h func()) *WatcherHandlerRegistration

	// DeleteMeshHandler unregisters a callback handler when remote cluster is removed.
	DeleteMeshHandler(registration *WatcherHandlerRegistration)
}

Watcher is a Holder whose mesh config can be updated asynchronously.

type WatcherHandlerRegistration

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

WatcherHandlerRegistration will be returned to caller to remove the handler later.

func NewWatcherHandlerRegistration

func NewWatcherHandlerRegistration(f func()) *WatcherHandlerRegistration

func (*WatcherHandlerRegistration) Remove

func (r *WatcherHandlerRegistration) Remove()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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