mirror of
				https://github.com/StackExchange/dnscontrol.git
				synced 2024-05-11 05:55:12 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			13 lines
		
	
	
		
			334 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			13 lines
		
	
	
		
			334 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package jmespath
 | |
| 
 | |
| // Search evaluates a JMESPath expression against input data and returns the result.
 | |
| func Search(expression string, data interface{}) (interface{}, error) {
 | |
| 	intr := newInterpreter()
 | |
| 	parser := NewParser()
 | |
| 	ast, err := parser.Parse(expression)
 | |
| 	if err != nil {
 | |
| 		return nil, err
 | |
| 	}
 | |
| 	return intr.Execute(ast, data)
 | |
| }
 |