config

package
v0.4.12 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	HTTPPort int
	GRPCPort int
)
View Source
var RawRequestConfigs = map[string]*struct {
	Config         *placeholder.RawRequestConfig
	GetPayloadFunc func(r *http.Request) string
}{
	"rawrequest-set1": {
		Config: &placeholder.RawRequestConfig{Method: "POST", Path: "/{{payload}}", Headers: map[string]string{}, Body: ""},
		GetPayloadFunc: func(r *http.Request) string {
			return strings.TrimPrefix(r.URL.Path, "/")
		},
	},
	"rawrequest-set2": {
		Config: &placeholder.RawRequestConfig{Method: "POST", Path: "/", Headers: map[string]string{"X-Test": "{{payload}}"}, Body: ""},
		GetPayloadFunc: func(r *http.Request) string {
			return r.Header.Get("X-Test")
		},
	},
	"rawrequest-set3": {
		Config: &placeholder.RawRequestConfig{Method: "POST", Path: "/", Headers: map[string]string{}, Body: "{{payload}}"},
		GetPayloadFunc: func(r *http.Request) string {
			defer r.Body.Close()
			b, _ := io.ReadAll(r.Body)
			return string(b)
		},
	},
}

Functions

func GetConfig

func GetConfig() *config.Config

func PickUpTestPorts

func PickUpTestPorts() error

Types

type TestCasesMap

type TestCasesMap struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func GenerateTestCases

func GenerateTestCases() (testCases []*db.Case, testCasesMap *TestCasesMap)

func (*TestCasesMap) CheckTestCaseAvailability

func (tcm *TestCasesMap) CheckTestCaseAvailability(caseHash string) (string, bool)

func (*TestCasesMap) CountTestCases

func (tcm *TestCasesMap) CountTestCases() int

func (*TestCasesMap) GetRemainingValues

func (tcm *TestCasesMap) GetRemainingValues() []string

Jump to

Keyboard shortcuts

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