updated as per the review comments

This commit is contained in:
MohitKatare-protean
2025-03-30 19:13:02 +05:30
parent 244a7be7c1
commit f0e39e34e7
35 changed files with 1605 additions and 124 deletions

View File

@@ -3,14 +3,9 @@ package definition
import (
"context"
"net/url"
)
// Route defines the structure for the Route returned.
type Route struct {
TargetType string // "url" or "msgq" or "bap" or "bpp"
PublisherID string // For message queues
URL *url.URL // For API calls
}
"github.com/beckn/beckn-onix/pkg/model"
)
// RouterProvider initializes the a new Router instance with the given config.
type RouterProvider interface {
@@ -20,5 +15,5 @@ type RouterProvider interface {
// Router defines the interface for routing requests.
type Router interface {
// Route determines the routing destination based on the request context.
Route(ctx context.Context, url *url.URL, body []byte) (*Route, error)
Route(ctx context.Context, url *url.URL, body []byte) (*model.Route, error)
}