Documentation

Overview

    Package xds contains an implementation of the xDS suite of protocols, to be used by gRPC client and server applications.

    On the client-side, users simply need to import this package to get all xDS functionality. On the server-side, users need to use the GRPCServer type exported by this package instead of the regular grpc.Server.

    See https://github.com/grpc/grpc-go/tree/master/examples/features/xds for example.

    Index

    Constants

    This section is empty.

    Variables

    This section is empty.

    Functions

    This section is empty.

    Types

    type GRPCServer

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

    GRPCServer wraps a gRPC server and provides server-side xDS functionality, by communication with a management server using xDS APIs. It implements the grpc.ServiceRegistrar interface and can be passed to service registration functions in IDL generated code.

    Experimental

    Notice: This type is EXPERIMENTAL and may be changed or removed in a later release.

    func NewGRPCServer

    func NewGRPCServer(opts ...grpc.ServerOption) *GRPCServer

    NewGRPCServer creates an xDS-enabled gRPC server using the passed in opts. The underlying gRPC server has no service registered and has not started to accept requests yet.

    Experimental

    Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

    func (*GRPCServer) GracefulStop

    func (s *GRPCServer) GracefulStop()

      GracefulStop stops the underlying gRPC server gracefully. It stops the server from accepting new connections and RPCs and blocks until all the pending RPCs are finished.

      func (*GRPCServer) RegisterService

      func (s *GRPCServer) RegisterService(sd *grpc.ServiceDesc, ss interface{})

        RegisterService registers a service and its implementation to the underlying gRPC server. It is called from the IDL generated code. This must be called before invoking Serve.

        func (*GRPCServer) Serve

        func (s *GRPCServer) Serve(lis net.Listener) error

          Serve gets the underlying gRPC server to accept incoming connections on the listener lis, which is expected to be listening on a TCP port.

          A connection to the management server, to receive xDS configuration, is initiated here.

          Serve will return a non-nil error unless Stop or GracefulStop is called. TODO: Support callback to get notified on serving state changes.

          func (*GRPCServer) Stop

          func (s *GRPCServer) Stop()

            Stop stops the underlying gRPC server. It immediately closes all open connections. It cancels all active RPCs on the server side and the corresponding pending RPCs on the client side will get notified by connection errors.

            Directories

            Path Synopsis
            Package csds implements features to dump the status (xDS responses) the xds_client is using.
            Package csds implements features to dump the status (xDS responses) the xds_client is using.
            Package googledirectpath implements a resolver that configures xds to make cloud to prod directpath connection.
            Package googledirectpath implements a resolver that configures xds to make cloud to prod directpath connection.
            Package internal contains functions/structs shared by xds balancers/resolvers.
            Package internal contains functions/structs shared by xds balancers/resolvers.
            balancer
            Package balancer installs all the xds balancers.
            Package balancer installs all the xds balancers.
            balancer/balancergroup
            Package balancergroup implements a utility struct to bind multiple balancers into one balancer.
            Package balancergroup implements a utility struct to bind multiple balancers into one balancer.
            balancer/cdsbalancer
            Package cdsbalancer implements a balancer to handle CDS responses.
            Package cdsbalancer implements a balancer to handle CDS responses.
            balancer/clusterimpl
            Package clusterimpl implements the xds_cluster_impl balancing policy.
            Package clusterimpl implements the xds_cluster_impl balancing policy.
            balancer/clustermanager
            Package clustermanager implements the cluster manager LB policy for xds.
            Package clustermanager implements the cluster manager LB policy for xds.
            balancer/edsbalancer
            Package edsbalancer contains EDS balancer implementation.
            Package edsbalancer contains EDS balancer implementation.
            balancer/loadstore
            Package loadstore contains the loadStoreWrapper shared by the balancers.
            Package loadstore contains the loadStoreWrapper shared by the balancers.
            balancer/lrs
            Package lrs implements load reporting balancer for xds.
            Package lrs implements load reporting balancer for xds.
            balancer/orca
            Package orca implements Open Request Cost Aggregation.
            Package orca implements Open Request Cost Aggregation.
            balancer/priority
            Package priority implements the priority balancer.
            Package priority implements the priority balancer.
            balancer/weightedtarget
            Package weightedtarget implements the weighted_target balancer.
            Package weightedtarget implements the weighted_target balancer.
            balancer/weightedtarget/weightedaggregator
            Package weightedaggregator implements state aggregator for weighted_target balancer.
            Package weightedaggregator implements state aggregator for weighted_target balancer.
            client
            Package client implements a full fledged gRPC client for the xDS API used by the xds resolver and balancer implementations.
            Package client implements a full fledged gRPC client for the xDS API used by the xds resolver and balancer implementations.
            client/bootstrap
            Package bootstrap provides the functionality to initialize certain aspects of an xDS client by reading a bootstrap file.
            Package bootstrap provides the functionality to initialize certain aspects of an xDS client by reading a bootstrap file.
            client/load
            Package load provides functionality to record and maintain load data.
            Package load provides functionality to record and maintain load data.
            client/v2
            Package v2 provides xDS v2 transport protocol specific functionality.
            Package v2 provides xDS v2 transport protocol specific functionality.
            client/v3
            Package v3 provides xDS v3 transport protocol specific functionality.
            Package v3 provides xDS v3 transport protocol specific functionality.
            httpfilter
            Package httpfilter contains the HTTPFilter interface and a registry for storing and retrieving their implementations.
            Package httpfilter contains the HTTPFilter interface and a registry for storing and retrieving their implementations.
            httpfilter/fault
            Package fault implements the Envoy Fault Injection HTTP filter.
            Package fault implements the Envoy Fault Injection HTTP filter.
            httpfilter/router
            Package router implements the Envoy Router HTTP filter.
            Package router implements the Envoy Router HTTP filter.
            resolver
            Package resolver implements the xds resolver, that does LDS and RDS to find the cluster to use.
            Package resolver implements the xds resolver, that does LDS and RDS to find the cluster to use.
            server
            Package server contains internal server-side functionality used by the public facing xds package.
            Package server contains internal server-side functionality used by the public facing xds package.
            testutils
            Package testutils provides utility types, for use in xds tests.
            Package testutils provides utility types, for use in xds tests.
            testutils/e2e
            Package e2e provides utilities for end2end testing of xDS functionality.
            Package e2e provides utilities for end2end testing of xDS functionality.
            testutils/fakeclient
            Package fakeclient provides a fake implementation of an xDS client.
            Package fakeclient provides a fake implementation of an xDS client.
            testutils/fakeserver
            Package fakeserver provides a fake implementation of the management server.
            Package fakeserver provides a fake implementation of the management server.
            version
            Package version defines constants to distinguish between supported xDS API versions.
            Package version defines constants to distinguish between supported xDS API versions.