Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrUnknownFormat = errors.New("unknown JSON data format")
Functions ¶
func ExchangeJSON ¶
func ExchangeJSON(ctx context.Context, client *http.Client, endpoint string, data interface{}) (interface{}, error)
ExchangeJSON POSTs JSON to an URL and parses the response JSON into a map hierarchy. If a non-200 response is returned, the returned url.Error wraps a FailedRequestError.
Types ¶
type FailedRequestError ¶ added in v1.1.0
FailedRequestError represents a non-200 response from the Mojang servers, incl. potential JSON error types and messages.
func UnwrapFailedRequestError ¶ added in v1.1.0
func UnwrapFailedRequestError(uerr error) (err *FailedRequestError, ok bool)
func (*FailedRequestError) Error ¶ added in v1.1.0
func (err *FailedRequestError) Error() string
Click to show internal directories.
Click to hide internal directories.