config

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2023 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Port       int       `yaml:"port"`
	PrettyLogs bool      `yaml:"pretty-logs"`
	Services   []Service `yaml:"services"`
}

Config configuration yaml structure

type Delay

type Delay struct {
	Min string `yaml:"min"`
	Max string `yaml:"max"`
}

type Parser

type Parser struct {
	Pattern         string            `yaml:"pattern"`
	Rewrites        []Rewrite         `yaml:"rewrite"`
	Methods         []string          `yaml:"methods"`
	Headers         map[string]string `yaml:"headers"`
	QueryParams     map[string]string `yaml:"queryParams"`
	ConfigType      string            `yaml:"type"`
	TransformLib    string            `yaml:"transform-lib"`
	TransformSymbol string            `yaml:"transform-symbol"`
	Responses       []Response        `yaml:"responses"`
	PassBaseURI     string            `yaml:"pass-base-uri"`
	Log             bool              `yaml:"log"`
}

Parser yaml structure

type Response

type Response struct {
	Headers           map[string]string `yaml:"headers"`
	Status            map[string]int    `yaml:"status"`
	BodyType          string            `yaml:"body-type"`
	Body              string            `yaml:"body"`
	BodyFile          string            `yaml:"body-file"`
	ResponseLib       string            `yaml:"response-lib"`
	ResponseSymbol    string            `yaml:"response-symbol"`
	MagicHeaderName   string            `yaml:"magic-header-name"`
	MagicHeaderFolder string            `yaml:"magic-header-folder"`
	Distribuition     float64           `yaml:"distribution"`
	Delay             Delay             `yaml:"delay"`
}

Response yaml structure

type Rewrite

type Rewrite struct {
	Source string `yaml:"source"`
	Target string `yaml:"target"`
}

Rewrite yaml structure

type Service

type Service struct {
	Parser Parser `yaml:"parser"`
}

Service yaml structure

Jump to

Keyboard shortcuts

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