response

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2020 License: MIT Imports: 1 Imported by: 2

Documentation

Index

Constants

View Source
const (
	ErrCodeIO                       = -1
	ErrCodeOk                       = 0
	ErrCodeAppTicketInvalid         = 10012
	ErrCodeAccessTokenInvalid       = 99991671
	ErrCodeAppAccessTokenInvalid    = 99991664
	ErrCodeTenantAccessTokenInvalid = 99991663
	ErrCodeUserAccessTokenInvalid   = 99991668
	ErrCodeUserRefreshTokenInvalid  = 99991669
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Detail

type Detail struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type Error

type Error struct {
	Code                 int                    `json:"code"`
	Msg                  string                 `json:"msg"`
	Details              []*Detail              `json:"details,omitempty"`
	PermissionViolations []*PermissionViolation `json:"permission_violations,omitempty"`
	FieldViolations      []*FieldViolation      `json:"field_violations,omitempty"`
	Helps                []*Help                `json:"helps,omitempty"`
}

func NewError

func NewError(err error) *Error

func NewErrorOfInvalidResp

func NewErrorOfInvalidResp(msg string) *Error

func ToError

func ToError(err error) *Error

func (Error) Error

func (e Error) Error() string

func (Error) Retryable

func (e Error) Retryable() bool

type FieldViolation

type FieldViolation struct {
	Field       string `json:"field"`
	Value       string `json:"value"`
	Description string `json:"description"`
}

type Help

type Help struct {
	Url         string `json:"url"`
	Description string `json:"description"`
}

type NoData

type NoData struct {
}

type PermissionViolation

type PermissionViolation struct {
	Type        string `json:"type"`
	Subject     string `json:"subject"`
	Description string `json:"description"`
}

type Response

type Response struct {
	Error
	Data interface{} `json:"data"`
}

Jump to

Keyboard shortcuts

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