packaging

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package packaging provides functions to convert to and from http.Request/Response and json marshallable equivalents.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UnpackageHttpRequest

func UnpackageHttpRequest(h *HttpRequest) (*http.Request, error)

func UnpackageHttpResponse

func UnpackageHttpResponse(h *HttpResponse, req *http.Request) (*http.Response, error)

Types

type HttpRequest

type HttpRequest struct {
	Method      string
	URL         string
	Host        string
	Path        string
	QueryString string
	Scheme      string
	Body        string
	ID          string
	LocalID     int64
	Headers     []KeyValue
	Query       []KeyValue
	Tags        []string
}

func PackageHttpRequest

func PackageHttpRequest(request *http.Request, proxyID string, reqID int64) (*HttpRequest, error)

type HttpResponse

type HttpResponse struct {
	Body       string
	StatusCode int
	ID         string
	LocalID    int64
	Headers    []KeyValue
	Tags       []string
	BodySize   int
}

func PackageHttpResponse

func PackageHttpResponse(response *http.Response, proxyID string, reqID int64) (*HttpResponse, error)

type KeyValue

type KeyValue struct {
	Key   string
	Value string
}

Jump to

Keyboard shortcuts

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