Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCluster

func NewCluster(name string, connectTimeout time.Duration, endpoints []*endpoint.LbEndpoint,
	isHTTP2 bool, discoveryType v2.Cluster_DiscoveryType) *v2.Cluster

func NewHTTPConnectionManager

func NewHTTPConnectionManager(virtualHosts []*route.VirtualHost) httpconnectionmanagerv2.HttpConnectionManager

func NewHTTPListener

func NewHTTPListener(manager *httpconnmanagerv2.HttpConnectionManager, port uint32) (*v2.Listener, error)

func NewHTTPSListener

func NewHTTPSListener(manager *httpconnmanagerv2.HttpConnectionManager,
	port uint32,
	certificateChain string,
	privateKey string) (*v2.Listener, error)

func NewHTTPSListenerWithSNI

func NewHTTPSListenerWithSNI(manager *httpconnmanagerv2.HttpConnectionManager, port uint32, sniMatches []*SNIMatch) (*v2.Listener, error)

    Configures a Listener with SNI. Ref: https://www.envoyproxy.io/docs/envoy/latest/faq/configuration/sni.html

    func NewLBEndpoint

    func NewLBEndpoint(ip string, port uint32) *endpoint.LbEndpoint

    func NewRDSHTTPConnectionManager

    func NewRDSHTTPConnectionManager(routeConfigName string) httpconnectionmanagerv2.HttpConnectionManager_Rds

    func NewRoute

    func NewRoute(name string,
    	path string,
    	wrs []*route.WeightedCluster_ClusterWeight,
    	routeTimeout time.Duration,
    	retryAttempts uint32,
    	perTryTimeout time.Duration,
    	headers map[string]string) *route.Route

    func NewRouteStatusOK

    func NewRouteStatusOK(name string, path string) *route.Route

      Creates a route that simply returns 200

      func NewVirtualHost

      func NewVirtualHost(name string, domains []string, routes []*route.Route) route.VirtualHost

      func NewVirtualHostWithExtAuthz

      func NewVirtualHostWithExtAuthz(name string, contextExtensions map[string]string, domains []string,
      	routes []*route.Route) route.VirtualHost

      func NewWeightedCluster

      func NewWeightedCluster(name string, trafficPerc uint32, headers map[string]string) *route.WeightedCluster_ClusterWeight

      Types

      type Callbacks

      type Callbacks struct {
      	Logger  *zap.SugaredLogger
      	OnError func()
      }

      func (*Callbacks) OnFetchRequest

      func (cb *Callbacks) OnFetchRequest(ctx context.Context, req *v2.DiscoveryRequest) error

        OnFetchRequest is called for each Fetch request. Returning an error will end processing of the request and respond with an error.

        func (*Callbacks) OnFetchResponse

        func (cb *Callbacks) OnFetchResponse(req *v2.DiscoveryRequest, resp *v2.DiscoveryResponse)

          OnFetchResponse is called immediately prior to sending a response.

          func (*Callbacks) OnStreamClosed

          func (cb *Callbacks) OnStreamClosed(id int64)

            OnStreamClosed is called immediately prior to closing an xDS stream with a stream ID.

            func (*Callbacks) OnStreamOpen

            func (cb *Callbacks) OnStreamOpen(ctx context.Context, id int64, typ string) error

              Returning an error will end processing and close the stream. OnStreamClosed will still be called.

              func (*Callbacks) OnStreamRequest

              func (cb *Callbacks) OnStreamRequest(_ int64, req *v2.DiscoveryRequest) error

                OnStreamRequest is called once a request is received on a stream. Returning an error will end processing and close the stream. OnStreamClosed will still be called.

                func (*Callbacks) OnStreamResponse

                func (cb *Callbacks) OnStreamResponse(i int64, request *v2.DiscoveryRequest, response *v2.DiscoveryResponse)

                  OnStreamResponse is called immediately prior to sending a response on a stream.

                  type ExternalAuthzConfig

                  type ExternalAuthzConfig struct {
                  	Enabled          bool
                  	Host             string
                  	Port             int
                  	FailureModeAllow bool
                  	MaxRequestBytes  int
                  	Timeout          duration.Duration
                  	Cluster          *v2.Cluster
                  	HTTPFilter       *httpconnectionmanagerv2.HttpFilter
                  }

                  func GetExternalAuthzConfig

                  func GetExternalAuthzConfig() ExternalAuthzConfig

                  type SNIMatch

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

                  func NewSNIMatch

                  func NewSNIMatch(hosts []string, certificateChain string, privateKey string) SNIMatch

                  type XdsServer

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

                  func NewXdsServer

                  func NewXdsServer(gatewayPort uint, managementPort uint, callbacks xds.Callbacks) *XdsServer

                  func (*XdsServer) RunGateway

                  func (envoyXdsServer *XdsServer) RunGateway()

                    RunManagementGateway starts an HTTP gateway to an xDS server.

                    func (*XdsServer) RunManagementServer

                    func (envoyXdsServer *XdsServer) RunManagementServer()

                      RunManagementServer starts an xDS server at the given Port.

                      func (*XdsServer) SetSnapshot

                      func (envoyXdsServer *XdsServer) SetSnapshot(snapshot *cache.Snapshot, nodeID string) error