erp

package
v0.0.0-...-905bf1f Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Server
	INTERNAL_ERROR = 10000 + iota

	// 4xx
	BAD_REQUEST
	UNAUTHORIZED
	FORBIDDEN

	// Video
	VIDEO_NOT_FOUND
)

Variables

View Source
var (
	Internal = _new(INTERNAL_ERROR)

	BadRequest   = _new(BAD_REQUEST)
	Unauthorized = _new(UNAUTHORIZED)
	Forbidden    = _new(FORBIDDEN)

	VideoNotFound = _new(VIDEO_NOT_FOUND)
)

Functions

This section is empty.

Types

type ErrResp

type ErrResp struct {
	// contains filtered or unexported fields
}

func Covert

func Covert(err error) *ErrResp

func New

func New(code int64, format string, a ...any) *ErrResp

func (*ErrResp) Error

func (erp *ErrResp) Error() string

*

error

func (*ErrResp) HttpCode

func (erp *ErrResp) HttpCode() int

func (*ErrResp) MarshalJSON

func (erp *ErrResp) MarshalJSON() ([]byte, error)

func (*ErrResp) UnmarshalJSON

func (erp *ErrResp) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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