573 - New plugin - schema mapper

This commit is contained in:
Mayuresh Nirhali
2025-12-05 16:09:02 +05:30
parent c1073dcb5c
commit 96fac33be1
9 changed files with 765 additions and 5 deletions

View File

@@ -0,0 +1,23 @@
package main
import (
"context"
"net/http"
"github.com/beckn-one/beckn-onix/pkg/plugin/implementation/reqmapper"
)
type provider struct{}
func (p provider) New(ctx context.Context, c map[string]string) (func(http.Handler) http.Handler, error) {
config := &reqmapper.Config{}
if role, ok := c["role"]; ok {
config.Role = role
}
if mappingsFile, ok := c["mappingsFile"]; ok {
config.MappingsFile = mappingsFile
}
return reqmapper.NewReqMapper(config)
}
var Provider = provider{}