response

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2024 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsResponseWithError

func IsResponseWithError(body []byte) error

Types

type Failure

type Failure interface {
	Failed() *Status
}

Failure is an interface that returns an api.Status (which implements Error) if there was an error in an API call.

type Response

type Response struct {
	Status Status `json:"ResponseStatus"`
}

Response is a generic response container.

This is useful if you don't care about the response from the API, as long as there wasn't any errors.

func (Response) Failed

func (o Response) Failed() *Status

type Status

type Status struct {
	Code   int    `json:"ErrorCode"`
	Reason string `json:"Reason"`
}

Status is a container for the status of API calls.

This contains the error code and the reason.

func NewUnknownPathError

func NewUnknownPathError(v []string) *Status

func (Status) Error

func (s Status) Error() string

func (Status) Failed

func (s Status) Failed() *Status

func (Status) ObjectNotFound

func (s Status) ObjectNotFound() bool

Jump to

Keyboard shortcuts

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