response

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrCodeUnknown = iota
	ErrCodeInvalidArguments
	ErrCodeAlreadyExists
	ErrCodeNotFound
)

Variables

This section is empty.

Functions

func HttpCode

func HttpCode(errorCode int) int

func Json

func Json(w io.Writer, lg *zap.SugaredLogger, v interface{}) error

func Yaml

func Yaml(w io.Writer, lg *zap.SugaredLogger, v interface{}) error

Types

type ApiError

type ApiError struct {
	HttpStatus int         `json:"http_status,omitempty"`
	ErrorCode  int         `json:"code"`
	Message    interface{} `json:"message"`
	Timestamp  interface{} `json:"timestamp"`
}

func NewApiError

func NewApiError(code int, msg string) *ApiError

func (ApiError) Error

func (e ApiError) Error() string

func (ApiError) String

func (e ApiError) String() string

Jump to

Keyboard shortcuts

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