common

package
v0.0.0-...-a201539 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Get            = "GET"
	GetPukEndpoint = "/login"
)

Variables

View Source
var DefaultHeaders = map[string]string{
	"App_id":     "prismer@ai",
	"Request_id": "123",
	"Span_id":    "123",
	"Trace_id":   "123",
	"Parent_id":  "123",
	"Client_ip":  "123.123.123.123",
	"User-Agent": "postman",
	"Signature":  core.GenAppSignature("prismer@ai", "prismer@ai", "", "123"),
}

Functions

func BuildHttpHeaders

func BuildHttpHeaders(headerInfo map[string]string) http.Header

func BuildHttpRequest

func BuildHttpRequest(requestMethod string, appURL string, endpoint string, headers http.Header, rawRequestBody string) (*http.Request, error)

func LoadConfig

func LoadConfig(env string)

func MakeHttpRequest

func MakeHttpRequest(request *http.Request) (*http.Response, error)

func MustReadBody

func MustReadBody(response *http.Response) []byte

func ReadFile

func ReadFile(requestFile string) []byte

func RunTest

func RunTest(
	appURL, endpoint, requestMethod, requestBody string,
	headers http.Header,
	expectedStatusCode int,
	expectedResponse map[string]any,
)

Types

This section is empty.

Jump to

Keyboard shortcuts

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