api

package
v0.0.0-...-7b46ad5 Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFileNotFound       = stderrors.New("File not found")
	ForbiddenErr    error = &Error{
		StatusCode: 403,
		Err:        stderrors.New("403 Forbidden"),
	}
	UnavailableErr error = &Error{
		StatusCode: 503,
		Err:        stderrors.New("503 Service Unavailable"),
	}
)

Functions

func HTTPErrorResponse

func HTTPErrorResponse(response *http.Response, err error) error

func RequestRetry

func RequestRetry(c *http.Client, req *http.Request) (*http.Response, error)

Types

type ContextKey

type ContextKey string
const ContextAcceptValue ContextKey = "Accept"

type Error

type Error struct {
	StatusCode int
	Err        error
	RequestURL *string
	Errors     []error
}

func (*Error) Error

func (e *Error) Error() string

type Errors

type Errors struct {
	Field   string `json:"field,omitempty"`
	Message string `json:"message,omitempty"`
}

type GenericErrorResponse

type GenericErrorResponse struct {
	ID      string   `json:"id,omitempty"`
	Message string   `json:"message,omitempty"`
	Errors  []Errors `json:"errors,omitempty"`
}

Jump to

Keyboard shortcuts

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