rkerror

package
v2.2.4 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2022 License: Apache-2.0 Imports: 2 Imported by: 21

Documentation

Overview

Package rkerror defines RK style API errors.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorAMZN added in v2.2.0

type ErrorAMZN struct {
	Resp struct {
		Errors []*ErrorElementAMZN `json:"errors" yaml:"errors"`
	} `json:"response" yaml:"response"`
}

func (*ErrorAMZN) Code added in v2.2.0

func (err *ErrorAMZN) Code() int

func (*ErrorAMZN) Details added in v2.2.0

func (err *ErrorAMZN) Details() []interface{}

func (*ErrorAMZN) Error added in v2.2.0

func (err *ErrorAMZN) Error() string

Error returns string of error

func (*ErrorAMZN) Message added in v2.2.0

func (err *ErrorAMZN) Message() string

type ErrorBuilder added in v2.2.0

type ErrorBuilder interface {
	New(code int, msg string, details ...interface{}) ErrorInterface

	NewCustom() ErrorInterface
}

func NewErrorBuilderAMZN added in v2.2.0

func NewErrorBuilderAMZN() ErrorBuilder

func NewErrorBuilderGoogle added in v2.2.0

func NewErrorBuilderGoogle() ErrorBuilder

type ErrorBuilderAMZN added in v2.2.0

type ErrorBuilderAMZN struct{}

func (*ErrorBuilderAMZN) New added in v2.2.0

func (e *ErrorBuilderAMZN) New(code int, msg string, details ...interface{}) ErrorInterface

func (*ErrorBuilderAMZN) NewCustom added in v2.2.0

func (e *ErrorBuilderAMZN) NewCustom() ErrorInterface

type ErrorBuilderGoogle added in v2.2.0

type ErrorBuilderGoogle struct{}

func (*ErrorBuilderGoogle) New added in v2.2.0

func (e *ErrorBuilderGoogle) New(code int, msg string, details ...interface{}) ErrorInterface

func (*ErrorBuilderGoogle) NewCustom added in v2.2.0

func (e *ErrorBuilderGoogle) NewCustom() ErrorInterface

type ErrorElementAMZN added in v2.2.0

type ErrorElementAMZN struct {
	Err struct {
		Code    int           `json:"code" yaml:"code" example:"500"`
		Status  string        `json:"status" yaml:"status" example:"Internal Server Error"`
		Message string        `json:"message" yaml:"message" example:"Internal error occurs"`
		Details []interface{} `json:"details" yaml:"details"`
	} `json:"error" json:"error"`
}

type ErrorGoogle added in v2.2.0

type ErrorGoogle struct {
	Err struct {
		Code    int           `json:"code" yaml:"code" example:"500"`
		Status  string        `json:"status" yaml:"status" example:"Internal Server Error"`
		Message string        `json:"message" yaml:"message" example:"Internal error occurs"`
		Details []interface{} `json:"details" yaml:"details"`
	} `json:"error" yaml:"error"`
}

ErrorGoogle is standard google style error Referred google style: https://cloud.google.com/apis/design/errors

func (*ErrorGoogle) Code added in v2.2.0

func (err *ErrorGoogle) Code() int

func (*ErrorGoogle) Details added in v2.2.0

func (err *ErrorGoogle) Details() []interface{}

func (*ErrorGoogle) Error added in v2.2.0

func (err *ErrorGoogle) Error() string

Error returns string of error

func (*ErrorGoogle) Message added in v2.2.0

func (err *ErrorGoogle) Message() string

type ErrorInterface added in v2.2.0

type ErrorInterface interface {
	Error() string

	Code() int

	Message() string

	Details() []interface{}
}

Jump to

Keyboard shortcuts

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