httpmock

package
v0.0.0-...-ba69e81 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CHANNEL_CLEAR     = "clear"
	CHANNEL_MOCK      = "mock"
	PAYLOAD_SEPARATOR = "|"
)
View Source
const (
	DEFAULT_PORT      = "6379"
	SERVER_ADDR       = "localhost:" + DEFAULT_PORT
	NETWORK           = "tcp"
	SEPARATOR         = ","
	CONNECT_THRESHOLD = 1000
)

Variables

This section is empty.

Functions

func CheckErr

func CheckErr(e error)

func Connect

func Connect(mockString []string)

func SpaceMap

func SpaceMap(str string) string

func YamlToJsonString

func YamlToJsonString(data []byte) string

Types

type MockContext

type MockContext struct {
	Path   string      `json:"path" yaml:"path"`
	Method string      `json:"method" yaml:"method"`
	Code   string      `json:"code" yaml:"code"`
	Body   interface{} `json:"body" yaml:"body"`
	Header interface{} `json:"header" yaml:"header"`
}

func ReadMockFile

func ReadMockFile(path string) ([]MockContext, []string)

func ReadMockFiles

func ReadMockFiles(dir string, prefix *string) ([]MockContext, []string)

Jump to

Keyboard shortcuts

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