Added Router ID and query options to limit number of results

This commit is contained in:
Milos Gajdos
2019-06-09 23:19:56 +01:00
parent 9c57f32f58
commit 459f4c8387
2 changed files with 13 additions and 1 deletions

View File

@@ -18,6 +18,8 @@ type QueryOptions struct {
Service string
// Policy defines query lookup policy
Policy LookupPolicy
// Count defines max number of results to return
Count int
}
// EntryOpts allows to set the route query options
@@ -41,6 +43,13 @@ func QueryLookupPolicy(p LookupPolicy) QueryOption {
}
}
// ResultCount allows to set max results to return
func ResultCount(c int) QueryOption {
return func(o *QueryOptions) {
o.Count = c
}
}
// Query defines routing table query
type Query interface {
// Options returns query options