| 
									
										
										
										
											2017-09-14 09:36:06 +01:00
										 |  |  | package plugin | 
					
						
							| 
									
										
										
										
											2016-10-30 15:54:16 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | import ( | 
					
						
							| 
									
										
										
										
											2018-04-22 08:34:35 +01:00
										 |  |  | 	"context" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-09-14 09:36:06 +01:00
										 |  |  | 	"github.com/coredns/coredns/plugin/etcd/msg" | 
					
						
							| 
									
										
										
										
											2017-02-21 22:51:47 -08:00
										 |  |  | 	"github.com/coredns/coredns/request" | 
					
						
							| 
									
										
										
										
											2016-10-30 15:54:16 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	"github.com/miekg/dns" | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // ServiceBackend defines a (dynamic) backend that returns a slice of service definitions. | 
					
						
							|  |  |  | type ServiceBackend interface { | 
					
						
							| 
									
										
										
										
											2018-01-06 15:56:54 +00:00
										 |  |  | 	// Services communicates with the backend to retrieve the service definitions. Exact indicates | 
					
						
							|  |  |  | 	// on exact match should be returned. | 
					
						
							| 
									
										
										
										
											2019-03-26 14:37:30 +00:00
										 |  |  | 	Services(ctx context.Context, state request.Request, exact bool, opt Options) ([]msg.Service, error) | 
					
						
							| 
									
										
										
										
											2016-10-30 15:54:16 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-11-05 15:43:27 +00:00
										 |  |  | 	// Reverse communicates with the backend to retrieve service definition based on a IP address | 
					
						
							|  |  |  | 	// instead of a name. I.e. a reverse DNS lookup. | 
					
						
							| 
									
										
										
										
											2019-03-26 14:37:30 +00:00
										 |  |  | 	Reverse(ctx context.Context, state request.Request, exact bool, opt Options) ([]msg.Service, error) | 
					
						
							| 
									
										
										
										
											2016-11-05 15:43:27 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-10-30 15:54:16 +00:00
										 |  |  | 	// Lookup is used to find records else where. | 
					
						
							| 
									
										
										
										
											2019-03-26 14:37:30 +00:00
										 |  |  | 	Lookup(ctx context.Context, state request.Request, name string, typ uint16) (*dns.Msg, error) | 
					
						
							| 
									
										
										
										
											2016-10-30 15:54:16 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-07-01 18:19:57 -04:00
										 |  |  | 	// Returns _all_ services that matches a certain name. | 
					
						
							|  |  |  | 	// Note: it does not implement a specific service. | 
					
						
							| 
									
										
										
										
											2019-03-26 14:37:30 +00:00
										 |  |  | 	Records(ctx context.Context, state request.Request, exact bool) ([]msg.Service, error) | 
					
						
							| 
									
										
										
										
											2017-09-12 10:52:43 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-09-01 15:10:45 +08:00
										 |  |  | 	// IsNameError returns true if err indicated a record not found condition | 
					
						
							| 
									
										
										
										
											2017-09-12 10:52:43 +01:00
										 |  |  | 	IsNameError(err error) bool | 
					
						
							| 
									
										
										
										
											2017-11-01 10:11:34 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	// Serial returns a SOA serial number to construct a SOA record. | 
					
						
							|  |  |  | 	Serial(state request.Request) uint32 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// MinTTL returns the minimum TTL to be used in the SOA record. | 
					
						
							|  |  |  | 	MinTTL(state request.Request) uint32 | 
					
						
							| 
									
										
										
										
											2016-10-30 15:54:16 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // Options are extra options that can be specified for a lookup. | 
					
						
							| 
									
										
										
										
											2017-09-12 10:52:43 +01:00
										 |  |  | type Options struct{} |