response

package
v1.14.4 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2022 License: MIT Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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