http

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	SendRequest(ctx context.Context, method string, url string, body string, headers map[string][]string, skipTLSVerify bool, timeout time.Duration) (resp Response, err error)
}

Client is the interface to interact with HTTP

func NewClient

func NewClient(log logr.Logger) Client

NewClient returns a new Http Client

type Request

type Request struct {
	Method  string              `json:"method"`
	Body    string              `json:"body,omitempty"`
	URL     string              `json:"url"`
	Headers map[string][]string `json:"headers,omitempty"`
}

Request represents an HTTP request.

type Response

type Response struct {
	Body       string
	Headers    map[string][]string
	StatusCode int
}

Response represents an HTTP response.

Jump to

Keyboard shortcuts

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