Closed
Description
Use case:
Currently I need to forward request from my server to another ones. Unfortunatly I can not know in advance their urls (as suggested in documentation) as I need to make some calculations based on provided path and other rules.
What I did:
I created custom struct that satisfies ProxyBalancer interface
It works great but if I encounter error during the selection of next ProxyTarget it can't report the error and I need to panic, thus I would like to change the ProxyBalancer interface from:
ProxyBalancer interface {
AddTarget(*ProxyTarget) bool
RemoveTarget(string) bool
Next(echo.Context) *ProxyTarget
}
to
ProxyBalancer interface {
AddTarget(*ProxyTarget) bool
RemoveTarget(string) bool
Next(echo.Context) (*ProxyTarget, error)
}
The interface is used only in proxy.go, so the change IMO wont hurt.
If the change makes sense I could provide the necessary changes in PR.
Thanks in advance for your time.
Metadata
Metadata
Assignees
Labels
No labels