| 1 | package routing |
| 2 | |
| 3 | import ( |
| 4 | "fmt" |
| 5 | |
| 6 | "github.com/ipfs/kubo/config" |
| 7 | ) |
| 8 | |
| 9 | type ParamNeededError struct { |
| 10 | ParamName string |
| 11 | RouterType config.RouterType |
| 12 | } |
| 13 | |
| 14 | func NewParamNeededErr(param string, routing config.RouterType) error { |
| 15 | return &ParamNeededError{ |
| 16 | ParamName: param, |
| 17 | RouterType: routing, |
| 18 | } |
| 19 | } |
| 20 | |
| 21 | func (e *ParamNeededError) Error() string { |
| 22 | return fmt.Sprintf("configuration param '%v' is needed for %v delegated routing types", e.ParamName, e.RouterType) |
| 23 | } |