mirror of
https://github.com/go-micro/go-micro.git
synced 2025-03-17 20:28:06 +02:00
30 lines
578 B
Go
30 lines
578 B
Go
package router
|
|
|
|
// RIB is Routing Information Base
|
|
type RIB interface {
|
|
// Initi initializes RIB
|
|
Init(...RIBOption) error
|
|
// Options returns RIB options
|
|
Options() RIBOptions
|
|
// Routes returns routes in RIB
|
|
Routes() []Route
|
|
// String returns debug info
|
|
String() string
|
|
}
|
|
|
|
// RIBOptopn is used to configure RIB
|
|
type RIBOption func(*RIBOptions)
|
|
|
|
// RIBOptions allow to set RIB sources.
|
|
type RIBOptions struct {
|
|
// Source defines RIB source URL
|
|
Source string
|
|
}
|
|
|
|
// Source sets RIB source
|
|
func Source(s string) RIBOption {
|
|
return func(o *RIBOptions) {
|
|
o.Source = s
|
|
}
|
|
}
|