apiutil

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Doer

type Doer interface {
	Do(req *http.Request) (*http.Response, error)
}

Doer abstracts the ability to execute HTTP requests.

type Result

type Result struct {
	StatusCode int
	Body       []byte
	Header     http.Header
}

Result represents a simplified HTTP response payload.

func Request

func Request(
	ctx context.Context,
	client Doer,
	method string,
	baseURL string,
	path string,
	token string,
	headers map[string]string,
	body io.Reader,
) (*Result, error)

Request issues an HTTP request against the provided endpoint. If the provided path is not absolute it is resolved against the base URL. Headers are merged with defaults where the caller provided values take precedence.

Jump to

Keyboard shortcuts

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