google.golang.org/grpc@v1.72.2/xds/internal/clients/xdsclient/xdsclient.go (about) 1 //revive:disable:unused-parameter 2 3 /* 4 * 5 * Copyright 2025 gRPC authors. 6 * 7 * Licensed under the Apache License, Version 2.0 (the "License"); 8 * you may not use this file except in compliance with the License. 9 * You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, software 14 * distributed under the License is distributed on an "AS IS" BASIS, 15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 * See the License for the specific language governing permissions and 17 * limitations under the License. 18 * 19 */ 20 21 // Package xdsclient provides an xDS (* Discovery Service) client. 22 // 23 // It allows applications to: 24 // - Create xDS client instances with in-memory configurations. 25 // - Register watches for named resources. 26 // - Receive resources via an ADS (Aggregated Discovery Service) stream. 27 // - Register watches for named resources (e.g. listeners, routes, or 28 // clusters). 29 // 30 // This enables applications to dynamically discover and configure resources 31 // such as listeners, routes, clusters, and endpoints from an xDS management 32 // server. 33 package xdsclient 34 35 // XDSClient is a client which queries a set of discovery APIs (collectively 36 // termed as xDS) on a remote management server, to discover 37 // various dynamic resources. 38 type XDSClient struct { 39 } 40 41 // New returns a new xDS Client configured with the provided config. 42 func New(config Config) (*XDSClient, error) { 43 panic("unimplemented") 44 } 45 46 // WatchResource starts watching the specified resource. 47 // 48 // typeURL specifies the resource type implementation to use. The watch fails 49 // if there is no resource type implementation for the given typeURL. See the 50 // ResourceTypes field in the Config struct used to create the XDSClient. 51 // 52 // The returned function cancels the watch and prevents future calls to the 53 // watcher. 54 func (c *XDSClient) WatchResource(typeURL, name string, watcher ResourceWatcher) (cancel func()) { 55 panic("unimplemented") 56 } 57 58 // Close closes the xDS client. 59 func (c *XDSClient) Close() error { 60 panic("unimplemented") 61 } 62 63 // DumpResources returns the status and contents of all xDS resources being 64 // watched by the xDS client. 65 func (c *XDSClient) DumpResources() []byte { 66 panic("unimplemented") 67 }