reqmapper

package
v1.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 30, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewReqMapper

func NewReqMapper(cfg *Config) (func(http.Handler) http.Handler, error)

NewReqMapper returns a middleware that maps requests using JSONata expressions

Types

type Config

type Config struct {
	Role         string `yaml:"role"`         // "bap" or "bpp"
	MappingsFile string `yaml:"mappingsFile"` // required path to mappings YAML
}

Config represents the configuration for the request mapper middleware.

type MappingEngine

type MappingEngine struct {
	// contains filtered or unexported fields
}

MappingEngine handles JSONata-based transformations

func (*MappingEngine) GetMappingInfo

func (e *MappingEngine) GetMappingInfo() map[string]interface{}

GetMappingInfo returns information about loaded mappings

func (*MappingEngine) ReloadMappings

func (e *MappingEngine) ReloadMappings() error

ReloadMappings reloads all mapping files (useful for hot-reload scenarios)

func (*MappingEngine) Transform

func (e *MappingEngine) Transform(ctx context.Context, action string, req map[string]interface{}, role string) ([]byte, error)

Transform applies the appropriate mapping based on role and action

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL