resputil

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HTTPSuccess

func HTTPSuccess(resp *http.Response) bool

HTTPSuccess reports if the status code is success.

func HandleHTTPError

func HandleHTTPError(resp *http.Response) error

HandleHTTPError parses a http.Response into a HTTPError.

Types

type HTTPError

type HTTPError struct {
	Errors     []HTTPErrorItem
	Headers    http.Header
	Message    string
	RequestURL *url.URL
	StatusCode int
}

HTTPError represents an error response from the GitHub API.

func (*HTTPError) Error

func (err *HTTPError) Error() string

Allow HTTPError to satisfy error interface.

type HTTPErrorItem

type HTTPErrorItem struct {
	Code     string
	Field    string
	Message  string
	Resource string
}

HTTPErrorItem stores additional information about an error response returned from the GitHub API.

Jump to

Keyboard shortcuts

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