Files
onix/pkg/plugin/definition/router.go
2025-03-30 19:13:02 +05:30

20 lines
524 B
Go

package definition
import (
"context"
"net/url"
"github.com/beckn/beckn-onix/pkg/model"
)
// RouterProvider initializes the a new Router instance with the given config.
type RouterProvider interface {
New(ctx context.Context, config map[string]string) (Router, func() error, error)
}
// 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) (*model.Route, error)
}