response

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

type APIError struct {
	Message        string        `json:"message,omitempty"`
	HTTPStatusCode int           `json:"code,omitempty"`
	Details        ErrorResponse `json:"details,omitempty"`
	URL            *url.URL      `json:"url,omitempty"`
	Header         http.Header   `json:"header,omitempty"`
}

APIError includes the response from the Paystack API and some HTTP request info

func NewAPIError

func NewAPIError(resp *http.Response) *APIError

func (*APIError) Error

func (aerr *APIError) Error() string

APIError supports the error interface

type ErrorResponse

type ErrorResponse struct {
	Status  bool                   `json:"status,omitempty"`
	Message string                 `json:"message,omitempty"`
	Errors  map[string]interface{} `json:"errors,omitempty"`
}

ErrorResponse represents an error response from the Paystack API server

type ListMeta

type ListMeta struct {
	Total     int `json:"total"`
	Skipped   int `json:"skipped"`
	PerPage   int `json:"perPage"`
	Page      int `json:"page"`
	PageCount int `json:"pageCount"`
}

ListMeta is pagination metadata for paginated responses from the Paystack API

type RequestValues

type RequestValues url.Values

RequestValues aliased to url.Values as a workaround

func (RequestValues) MarshalJSON

func (v RequestValues) MarshalJSON() ([]byte, error)

MarshalJSON to handle custom JSON decoding for RequestValues

type Response

type Response map[string]interface{}

Response represents arbitrary response data

Jump to

Keyboard shortcuts

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