request

package
v0.0.0-...-1b2071a Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2026 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeRequest

func MakeRequest(method string, serviceURL string, endpoint string, opts ...Option) (*http.Request, error)

Types

type EpicErrorResponse

type EpicErrorResponse struct {
	ErrorCode          string   `json:"errorCode"`
	ErrorMessage       string   `json:"errorMessage"`
	NumericErrorCode   int      `json:"numericErrorCode"`
	OriginatingService string   `json:"originatingService"`
	MessageVars        []string `json:"messageVars,omitempty"`
	Intent             string   `json:"intent"`
	Continuation       string   `json:"continuation,omitempty"`
	ContinuationURL    string   `json:"continuationUrl,omitempty"`
	CorrectiveAction   string   `json:"correctiveAction,omitempty"`
}

type Error

type Error struct {
	Message   string
	ErrorCode string
	Raw       any
	Err       error
}

func (Error) Error

func (e Error) Error() string

func (Error) Unwrap

func (e Error) Unwrap() error

type Option

type Option func(*requestConfig) error

func WithBasicToken

func WithBasicToken(basicToken string) Option

func WithBearerToken

func WithBearerToken(accessToken string) Option

func WithBody

func WithBody(body io.Reader, contentType string) Option

func WithFormBody

func WithFormBody(values url.Values) Option

func WithHeader

func WithHeader(key, value string) Option

func WithHeaders

func WithHeaders(headers map[string]string) Option

func WithJSONBody

func WithJSONBody(v any) Option

func WithQueryParamaters

func WithQueryParamaters(query url.Values) Option

func WithTextBody

func WithTextBody(text string) Option

type Response

type Response[T any] struct {
	Data       T
	StatusCode int
	Headers    http.Header
}

func ParseResponse

func ParseResponse[T any](resp *http.Response) (Response[T], error)

Jump to

Keyboard shortcuts

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