INNER CODE UNIT · Go

dumpAPIGatewayV1

akrylysov/algnhsa · apigw_v1_test.go:126

func dumpAPIGatewayV1(payload []byte, opts Options) (RequestDebugDump, error) {
	lh := lambdaHandler{
		httpHandler: http.HandlerFunc(RequestDebugDumpHandler),
		opts:        &opts,
	}
	responseBytes, err := lh.Invoke(context.Background(), payload)
	if err != nil {
		return RequestDebugDump{}, err
	}
	var r events.APIGatewayProxyResponse
	if err := json.Unmarshal(responseBytes, &r); err != nil {
		return RequestDebugDump{}, err
	}
	if r.StatusCode != 200 {
		return RequestDebugDump{}, errors.New("expected status code 200")
	}
	var dump RequestDebugDump
	if err := json.Unmarshal([]byte(r.Body), &dump); err != nil {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…