-
Notifications
You must be signed in to change notification settings - Fork 3
/
default.go
39 lines (32 loc) · 878 Bytes
/
default.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package bgpfinder
// Global finder instance that includes all the built-in finder
// implementations (RV and RIS for now).
//
// If you have a custom (private) finder, you can either register it
// with this finder instance, or use it directly.
var DefaultFinder = mustInitDefaultFinder()
func mustInitDefaultFinder() Finder {
f, err := NewMultiFinder(
NewRouteViewsFinder(),
NewRISFinder(),
)
if err != nil {
panic(err)
}
return f
}
func Projects() ([]Project, error) {
return DefaultFinder.Projects()
}
func GetProject(name string) (Project, error) {
return DefaultFinder.Project(name)
}
func Collectors(project string) ([]Collector, error) {
return DefaultFinder.Collectors(project)
}
func GetCollector(name string) (Collector, error) {
return DefaultFinder.Collector(name)
}
func Find(query Query) ([]File, error) {
return DefaultFinder.Find(query)
}