xds

package
v0.0.0-...-81cdc2d Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 52 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProtocolHTTP  = "HTTP"
	ProtocolHTTPS = "HTTPS"
	ProtocolGRPC  = "GRPC"
	ProtocolGRPCS = "GRPCS"
)
View Source
const (
	InternalRoute      = "internal-route"
	ExternalRoute      = "external-route"
	DefaultVirtualHost = "default-virtual-host"
	ExternalListener   = "external-listener"
	InternalListener   = "internal-listener"
	InternalTLSPort    = 443
)

Variables

View Source
var (
	// IdleTimeout bounds the amount of time the request’s stream may be idle.
	// After header decoding, the idle timeout will apply on downstream and upstream request events.
	// Each time an encode/decode event for headers or data is processed for the stream, the timer will be reset.
	// If the timeout fires, the stream is terminated with a 408 Request Timeout error code if no upstream response header has been received, otherwise a stream reset occurs.
	IdleTimeout int
)

Functions

func AddDefaultTimeout

func AddDefaultTimeout(action *route.RouteAction) *route.RouteAction

func AddOrUpdateCluster

func AddOrUpdateCluster(conf *envoycluster.Cluster) error

func AddOrUpdateVirtualHost

func AddOrUpdateVirtualHost(vh *route.VirtualHost, routeName string) error

func AddTCPHealthCheck

func AddTCPHealthCheck(c *envoycluster.Cluster) *envoycluster.Cluster

func DecorateCluster

func DecorateCluster(cluster *envoycluster.Cluster)

func DecorateClusterTransport

func DecorateClusterTransport(cluster *envoycluster.Cluster, protocol string) error

func DecorateLocalUpstreamCluster

func DecorateLocalUpstreamCluster(cluster *envoycluster.Cluster, protocol string) error

func DecorateRemoteUpstreamCluster

func DecorateRemoteUpstreamCluster(cluster *envoycluster.Cluster, protocol string) error

func DeleteCluster

func DeleteCluster(name string) error

func DeleteRoute

func DeleteRoute(name, vhName, routeName string) error

func DeleteVirtualHost

func DeleteVirtualHost(name, routeName string) error

func GenerateDownstreamTLSConfigByCert

func GenerateDownstreamTLSConfigByCert(cert *TLSCert) (*core.TransportSocket, error)

func GenerateDownstreamTLSConfigByCertStr

func GenerateDownstreamTLSConfigByCertStr(cert, key, ca []byte) (*core.TransportSocket, error)

func GenerateHTTP2UpstreamHTTPOptions

func GenerateHTTP2UpstreamHTTPOptions(isRemoteCluster bool) *envoyhttp.HttpProtocolOptions

func GenerateProtocol

func GenerateProtocol(isTLS, isGRPC bool) string

func GenerateSimpleUpstreamHTTPOptions

func GenerateSimpleUpstreamHTTPOptions(isRemoteCluster bool) *envoyhttp.HttpProtocolOptions

func GenerateUpstreamHTTPOptions

func GenerateUpstreamHTTPOptions(cluster *envoycluster.Cluster, protocol string) error

func GenerateUpstreamTLSConfigByCert

func GenerateUpstreamTLSConfigByCert(cert *TLSCert) (*core.TransportSocket, error)

func GenerateUpstreamTLSConfigByCertStr

func GenerateUpstreamTLSConfigByCertStr(cert, key, ca []byte) (*core.TransportSocket, error)

func GetClusterHTTPProtocolOptions

func GetClusterHTTPProtocolOptions(clusterName string) (*envoyhttp.HttpProtocolOptions, *envoycluster.Cluster, error)

func GetHeaderDecorator

func GetHeaderDecorator() (*headerdecorator.HeaderDecorator, error)

func GetTokenAuth

func GetTokenAuth() (*kusciatoken.TokenAuth, error)

func InitSnapshot

func InitSnapshot(ns, instance string, initConfig *InitConfig)

func NewXdsServer

func NewXdsServer(port uint32, id string)

func QueryCluster

func QueryCluster(name string) (*envoycluster.Cluster, error)

func QueryVirtualHost

func QueryVirtualHost(name, routeName string) (*route.VirtualHost, error)

func SetCommonHTTPProtocolOptions

func SetCommonHTTPProtocolOptions(options *envoyhttp.HttpProtocolOptions)

func SetKeepAliveForDstCluster

func SetKeepAliveForDstCluster(c *envoycluster.Cluster, enable bool) error

func UpdateDecryptRules

func UpdateDecryptRules(rule *kusciacrypt.CryptRule, add bool) error

func UpdateEncryptRules

func UpdateEncryptRules(rule *kusciacrypt.CryptRule, add bool) error

func UpdateHeaderDecorator

func UpdateHeaderDecorator(newHeader *headerdecorator.HeaderDecorator_SourceHeader, add bool) error

func UpdateHeaderDecoratorConfig

func UpdateHeaderDecoratorConfig(config *anypb.Any, newHeader *headerdecorator.HeaderDecorator_SourceHeader,
	add bool) (*hcm.HttpFilter, error)

func UpdatePoller

func UpdatePoller(newHeader *kusciapoller.Poller_SourceHeader, add bool) error

func UpdateReceiverRules

func UpdateReceiverRules(rule *kusciareceiver.ReceiverRule, add bool) error

func UpdateTokenAuthAndHeaderDecorator

func UpdateTokenAuthAndHeaderDecorator(newToken *kusciatoken.TokenAuth_SourceToken,
	newHeader *headerdecorator.HeaderDecorator_SourceHeader, add bool) error

func UpdateTokenAuthConfig

func UpdateTokenAuthConfig(config *anypb.Any, newToken *kusciatoken.TokenAuth_SourceToken,
	add bool) (*hcm.HttpFilter, error)

Types

type ConfigTemplate

type ConfigTemplate struct {
	Namespace    string
	Instance     string
	ExternalPort uint32
	LogPrefix    string
}

type HTTPFilters

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

func (HTTPFilters) Len

func (f HTTPFilters) Len() int

func (HTTPFilters) Less

func (f HTTPFilters) Less(i, j int) bool

func (HTTPFilters) Swap

func (f HTTPFilters) Swap(i, j int)

type InitConfig

type InitConfig struct {
	Basedir      string
	Logdir       string
	XDSPort      uint32
	ExternalPort uint32

	ExternalCert *TLSCert
	InternalCert *TLSCert
}

type TLSCert

type TLSCert struct {
	CertData string
	KeyData  string
	CAData   string
}

Jump to

Keyboard shortcuts

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