You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I suggest making Methods param mandatory to make configuration discoverable. If it is not present or has some wrong methods, an error message will appear when Kubo starts, explaining what is wrong and the available methods for that router. Examples:
we found an error in the configuration. Router type "reframe" does not support "provide" method. Available methods: "get-providers", "get-ipns", "put-ipns"
we found an error in the configuration. "Methods" param is mandatory on "Routers" configuration. Available methods: "get-providers", "get-ipns", "put-ipns"
We can add a generic all method to simplify configuration if all methods are needed.
Implementation
I would say to keep it simple:
Create a list of available methods per routing type. This will be used to check if provided methods from config are correct.
Create a new Router wrapper that depending on the provided method list, will call or not the Router underneath. If the method is not allowed to be executed, the wrapper Router will return routing.ErrNotSupported
The text was updated successfully, but these errors were encountered:
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
Checklist
Description
Description
As described here #8997 (review) we need a way to specify methods that a router will use from config.
Actual proposed config file:
I suggest making
Methods
param mandatory to make configuration discoverable. If it is not present or has some wrong methods, an error message will appear when Kubo starts, explaining what is wrong and the available methods for that router. Examples:we found an error in the configuration. Router type "reframe" does not support "provide" method. Available methods: "get-providers", "get-ipns", "put-ipns"
we found an error in the configuration. "Methods" param is mandatory on "Routers" configuration. Available methods: "get-providers", "get-ipns", "put-ipns"
We can add a generic
all
method to simplify configuration if all methods are needed.Implementation
I would say to keep it simple:
routing.ErrNotSupported
The text was updated successfully, but these errors were encountered: