Documentation ¶
Index ¶
- type NodeInfo
- type XdsClient
- func (client *XdsClient) CDS() ([]apiv2.Cluster, error)
- func (client *XdsClient) EDS(clusterName string) (*apiv2.ClusterLoadAssignment, error)
- func (client *XdsClient) GetEndpointsByTags(serviceName string, tags map[string]string) ([]apiv2endpoint.LbEndpoint, string, error)
- func (client *XdsClient) GetSubsetTags(namespace, hostName, subsetName string) (map[string]string, error)
- func (client *XdsClient) LDS() ([]apiv2.Listener, error)
- func (client *XdsClient) RDS(clusterName string) ([]apiv2route.VirtualHost, error)
- type XdsClusterInfo
- type XdsReqCache
- type XdsType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type XdsClient ¶
type XdsClient struct { PilotAddr string TlsConfig *tls.Config ReqCaches map[XdsType]*XdsReqCache NodeID string NodeCluster string // contains filtered or unexported fields }
XdsClient provides the XDS API calls.
func NewXdsClient ¶
func NewXdsClient(pilotAddr string, tlsConfig *tls.Config, nodeInfo *NodeInfo, kubeconfigPath string) (*XdsClient, error)
NewXdsClient returns the new XDS client.
func (*XdsClient) CDS ¶
CDS s the Clsuter Discovery Service API, which fetches all the clusters from istio pilot
func (*XdsClient) EDS ¶
func (client *XdsClient) EDS(clusterName string) (*apiv2.ClusterLoadAssignment, error)
EDS is the Endpoint Discovery Service API, the API takes the cluster's name and return all its endpoints(which provide address and port)
func (*XdsClient) GetEndpointsByTags ¶
func (client *XdsClient) GetEndpointsByTags(serviceName string, tags map[string]string) ([]apiv2endpoint.LbEndpoint, string, error)
GetEndpointsByTags fetches the cluster's endpoints with tags. The tags is usually specified in a DestinationRule.
func (*XdsClient) GetSubsetTags ¶
func (client *XdsClient) GetSubsetTags(namespace, hostName, subsetName string) (map[string]string, error)
GetSubsetTags returns the tags of the specified subset.
func (*XdsClient) RDS ¶
func (client *XdsClient) RDS(clusterName string) ([]apiv2route.VirtualHost, error)
RDS is the Router Discovery Service API, it returns the virtual hosts which contains Routes
type XdsClusterInfo ¶
type XdsClusterInfo struct { ClusterName string Direction string Port string Subset string HostName string ServiceName string Namespace string DomainSuffix string // DomainSuffix might not be used Tags map[string]string Addrs []string // The accessible addresses of the endpoints }
XdsClusterInfo stores all the infos from a cluster name, which is in the format direction|port|subset|hostName
func ParseClusterName ¶
func ParseClusterName(clusterName string) *XdsClusterInfo
ParseClusterName parse the cluster's name, which is in the format direction|port|subset|hostName, the 4 items will be parsed into different fields. The hostName item will also be parsed into ServcieName, Namespace etc.
type XdsReqCache ¶
XdsReqCache stores the VersionInfo and Nonce for the XDS calls