xds

package
v1.0.0-cli.0...-2d063a8 Latest Latest
Warning

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

Go to latest
Published: May 4, 2026 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateAndRegisterServer

func CreateAndRegisterServer(ctx context.Context, logger *slog.Logger, server *grpc.Server, cache cache.SnapshotCache)

func CreateCLA

func CreateCLA(
	clusterName string,
	upstream netip.AddrPort,
	proto corev3.SocketAddress_Protocol,
) *endpointv3.ClusterLoadAssignment

CreateCLA creates a cluster load assignment with a single upstream endpoint

func CreateListener

func CreateListener(cfg ListenerConfig) *listenerv3.Listener

CreateListener creates a listener with a single listener filter config

func JSONStdoutAccessLog

func JSONStdoutAccessLog(format map[string]any) (*accesslogv3.AccessLog, error)

func OriginalDstListenerFilter

func OriginalDstListenerFilter() (*listenerv3.ListenerFilter, error)

func TCPProxyListener

func TCPProxyListener(listenerCfg ListenerConfig, proxyCfg TCPProxyConfig) (*listenerv3.Listener, error)

Types

type ListenerConfig

type ListenerConfig struct {
	ListenerName string
	StatPrefix   string
	Addr         netip.AddrPort
	Proto        corev3.SocketAddress_Protocol
}

type Map

type Map interface {
	Get(key string) ResourceGroup
	Put(ctx context.Context, key string, rg ResourceGroup) (*cache.Snapshot, error)
	Del(ctx context.Context, key string) (*cache.Snapshot, error)
}

Map is responsible for storing and applying envoy configuration resources. This is necessary, because when applying new resources all previous ones that are not contained in the snapshot will be removed by envoy. Implementations must be safe for concurrent use.

func NewMap

func NewMap(nodeID string, cache cache.SnapshotCache) Map

type ResourceGroup

type ResourceGroup struct {
	Clusters  []*clusterv3.Cluster
	Listeners []*listenerv3.Listener
	CLAS      []*endpointv3.ClusterLoadAssignment
}

ResourceGroup should be used for grouping related resources. For example all resources related to a DNS proxy should be placed into one specific instance of a ResourceGroup.

func (*ResourceGroup) ResourcesByType

func (rg *ResourceGroup) ResourcesByType() map[resource.Type][]types.Resource

ResourcesByType returns a map that can be used directly when applying a new snapshot.

type TCPProxyConfig

type TCPProxyConfig struct {
	StatPrefix  string
	ClusterName string
}

Jump to

Keyboard shortcuts

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