Update router querying method (#834)
* Add address to router query options. Drop Query interface for QueryOptions * Cleanup isMatch function * Update network proto
This commit is contained in:
		| @@ -90,13 +90,15 @@ func (t *table) List() ([]router.Route, error) { | ||||
| } | ||||
|  | ||||
| // Lookup looks up routes in the routing table and returns them | ||||
| func (t *table) Query(q router.Query) ([]router.Route, error) { | ||||
| func (t *table) Query(q ...router.QueryOption) ([]router.Route, error) { | ||||
| 	query := router.NewQuery(q...) | ||||
|  | ||||
| 	// call the router | ||||
| 	resp, err := t.table.Query(context.Background(), &pb.QueryRequest{ | ||||
| 		Query: &pb.Query{ | ||||
| 			Service: q.Options().Service, | ||||
| 			Gateway: q.Options().Gateway, | ||||
| 			Network: q.Options().Network, | ||||
| 			Service: query.Service, | ||||
| 			Gateway: query.Gateway, | ||||
| 			Network: query.Network, | ||||
| 		}, | ||||
| 	}, t.callOpts...) | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user