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

@@ -0,0 +1,24 @@
package main
import (
"context"
"net/http"
"strings"
"github.com/beckn/beckn-onix/pkg/plugin/implementation/reqpreprocessor"
)
type provider struct{}
func (p provider) New(ctx context.Context, c map[string]string) (func(http.Handler) http.Handler, error) {
config := &reqpreprocessor.Config{}
if contextKeysStr, ok := c["contextKeys"]; ok {
config.ContextKeys = strings.Split(contextKeysStr, ",")
}
if role, ok := c["role"]; ok {
config.Role = role
}
return reqpreprocessor.NewPreProcessor(config)
}
var Provider = provider{}