mapping

package
v0.0.0-...-009529a Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const Root = "."

Variables

This section is empty.

Functions

func HasMappingFileExtension

func HasMappingFileExtension(name string) bool

Types

type Flow

type Flow struct {
	Request  *RequestDefinition  `json:"request"`
	Response *ResponseDefinition `json:"response"`
	WebHook  *WebHookDefinition  `json:"web_hook"`
}

type Mapper

type Mapper interface {
	Refresh() error
	GetMappings() []Flow
}

func NewMapping

func NewMapping(config config.Config, fs fs.FS) Mapper

type RequestDefinition

type RequestDefinition struct {
	Method  string            `json:"method"`
	Path    string            `json:"path"`
	Body    map[string]any    `json:"body"`
	Headers map[string]string `json:"headers"`
}

type ResponseDefinition

type ResponseDefinition struct {
	Code           int               `json:"code"`
	Delay          int               `json:"delay"`
	IncludeRequest bool              `json:"includeRequest"`
	Headers        map[string]string `json:"headers"`
	Body           map[string]any    `json:"body"`
}

type WebHookDefinition

type WebHookDefinition struct {
	Method         string            `json:"method"`
	Path           string            `json:"path"`
	Delay          int               `json:"delay"`
	IncludeRequest bool              `json:"includeRequest"`
	Headers        map[string]string `json:"headers"`
	Body           map[string]any    `json:"body"`
}

Jump to

Keyboard shortcuts

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