http

package
v0.0.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const ProviderName = "http"

ProviderName .

Variables

Package .

Functions

This section is empty.

Types

type DoParams

type DoParams providers.Params[RequestVars]

DoParams is the params for http request

type DoReturns

type DoReturns providers.Returns[ResponseVars]

DoReturns returned struct for http response

func Do

func Do(ctx context.Context, doParams *DoParams) (*DoReturns, error)

Do execute http request and process returned result

type RequestVars

type RequestVars struct {
	Method  string `json:"method"`
	URL     string `json:"url"`
	Request struct {
		Body    string      `json:"body"`
		Header  http.Header `json:"header"`
		Trailer http.Header `json:"trailer"`
	} `json:"request"`
}

RequestVars is the vars for http request TODO: support timeout & tls

type ResponseVars

type ResponseVars struct {
	Body       string      `json:"body"`
	Header     http.Header `json:"header"`
	Trailer    http.Header `json:"trailer"`
	StatusCode int         `json:"statusCode"`
}

ResponseVars is the vars for http response

Jump to

Keyboard shortcuts

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