mirror of
https://github.com/ipfs/kubo.git
synced 2025-05-17 06:57:40 +08:00

New multi-router configuration system based on https://hackmd.io/G1KRDEX5T3qyfoBMkIrBew#Methods - Added a new routing type: "custom" - Added specific struct types for different Routers (instead of map[string]interface{}) - Added `Duration` config type, to make easier time string parsing - Added config documentation. - Use the latest go-delegated-routing library version with GET support. - Added changelog notes for this feature. It: - closes #9157 - closes #9079 - closes #9186
24 lines
462 B
Go
24 lines
462 B
Go
package routing
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/ipfs/kubo/config"
|
|
)
|
|
|
|
type ParamNeededError struct {
|
|
ParamName string
|
|
RouterType config.RouterType
|
|
}
|
|
|
|
func NewParamNeededErr(param string, routing config.RouterType) error {
|
|
return &ParamNeededError{
|
|
ParamName: param,
|
|
RouterType: routing,
|
|
}
|
|
}
|
|
|
|
func (e *ParamNeededError) Error() string {
|
|
return fmt.Sprintf("configuration param '%v' is needed for %v delegated routing types", e.ParamName, e.RouterType)
|
|
}
|