1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-05-17 06:57:40 +08:00
Files
kubo/routing/error.go
Antonio Navarro Perez d1b9e41fc2 feat: Delegated routing with custom configuration. (#9274)
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
2022-09-22 15:47:45 +02:00

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)
}