Documentation
¶
Index ¶
- func CreateAndRegisterServer(ctx context.Context, logger *slog.Logger, server *grpc.Server, ...)
- func CreateCLA(clusterName string, upstream netip.AddrPort, ...) *endpointv3.ClusterLoadAssignment
- func CreateListener(cfg ListenerConfig) *listenerv3.Listener
- func JSONStdoutAccessLog(format map[string]any) (*accesslogv3.AccessLog, error)
- func OriginalDstListenerFilter() (*listenerv3.ListenerFilter, error)
- func TCPProxyListener(listenerCfg ListenerConfig, proxyCfg TCPProxyConfig) (*listenerv3.Listener, error)
- type ListenerConfig
- type Map
- type ResourceGroup
- type TCPProxyConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateAndRegisterServer ¶
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 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.
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.