mirror of
				https://github.com/coredns/coredns.git
				synced 2025-10-30 17:53:21 -04:00 
			
		
		
		
	Traffic is a plugin that communicates via the xDS protocol to an Envoy control plane. Using the data from this control plane it hands out IP addresses. This allows you (via controlling the data in the control plane) to drain or send more traffic to specific endpoints. The plugin itself only acts upon this data; it doesn't do anything fancy by itself. Code used here is copied from grpc-go and other places, this is clearly marked in the source files. Signed-off-by: Miek Gieben <miek@miek.nl>
		
			
				
	
	
		
			38 lines
		
	
	
		
			667 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			38 lines
		
	
	
		
			667 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package xds
 | |
| 
 | |
| func (c *Client) Assignments() *assignment {
 | |
| 	c.mu.RLock()
 | |
| 	defer c.mu.RUnlock()
 | |
| 	return c.assignments
 | |
| }
 | |
| 
 | |
| func (c *Client) SetAssignments(a *assignment) {
 | |
| 	c.mu.Lock()
 | |
| 	defer c.mu.Unlock()
 | |
| 	c.assignments = a
 | |
| }
 | |
| 
 | |
| func (c *Client) Version(typeURL string) string {
 | |
| 	c.mu.RLock()
 | |
| 	defer c.mu.RUnlock()
 | |
| 	return c.version[typeURL]
 | |
| }
 | |
| 
 | |
| func (c *Client) SetVersion(typeURL, a string) {
 | |
| 	c.mu.Lock()
 | |
| 	defer c.mu.Unlock()
 | |
| 	c.version[typeURL] = a
 | |
| }
 | |
| 
 | |
| func (c *Client) Nonce(typeURL string) string {
 | |
| 	c.mu.RLock()
 | |
| 	defer c.mu.RUnlock()
 | |
| 	return c.nonce[typeURL]
 | |
| }
 | |
| 
 | |
| func (c *Client) SetNonce(typeURL, n string) {
 | |
| 	c.mu.Lock()
 | |
| 	defer c.mu.Unlock()
 | |
| 	c.nonce[typeURL] = n
 | |
| }
 |