config

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GraphQLConfigs = map[string]*struct {
	Config         *placeholder.GraphQLConfig
	Encoders       []string
	GetPayloadFunc func(r *http.Request) string
}{
	"graphql-set1": {
		Config:   &placeholder.GraphQLConfig{Method: "GET"},
		Encoders: []string{"URL"},
		GetPayloadFunc: func(r *http.Request) string {
			return r.URL.Query().Get("query")
		},
	},
	"rawrequest-set2": {
		Config:   &placeholder.GraphQLConfig{Method: "POST"},
		Encoders: []string{"Plain"},
		GetPayloadFunc: func(r *http.Request) string {
			defer r.Body.Close()
			b, _ := io.ReadAll(r.Body)
			return string(b)
		},
	},
}
View Source
var RawRequestConfigs = map[string]*struct {
	Config         *placeholder.RawRequestConfig
	Encoders       []string
	GetPayloadFunc func(r *http.Request) string
}{
	"rawrequest-set1": {
		Config:   &placeholder.RawRequestConfig{Method: "POST", Path: "/{{payload}}", Headers: map[string]string{}, Body: ""},
		Encoders: []string{"Base64", "Base64Flat", "URL"},
		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: ""},
		Encoders: []string{"Base64", "Base64Flat", "JSUnicode", "Plain", "URL", "XMLEntity"},
		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}}"},
		Encoders: []string{"Base64", "Base64Flat", "JSUnicode", "Plain", "URL", "XMLEntity"},
		GetPayloadFunc: func(r *http.Request) string {
			defer r.Body.Close()
			b, _ := io.ReadAll(r.Body)
			return string(b)
		},
	},
}

Functions

func GetConfigWithChromeClient added in v0.5.0

func GetConfigWithChromeClient(httpPort int, grpcPort int) *config.Config

func GetConfigWithGoHTTPClient added in v0.5.0

func GetConfigWithGoHTTPClient(httpPort int, grpcPort int) *config.Config

func PickUpTestPorts

func PickUpTestPorts() (httpPort, grpcPort int, err 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