gateway

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNil            = newBusinessError(0, "ok")
	ErrValidation     = newBusinessError(1, "Invalid parameter")
	ErrInternalServer = newBusinessError(2, "Internal server error")
)

General errors

View Source
var LocalFileRepo string = "."

Functions

func MustServeLocal

func MustServeLocal(nodes []*node.ZgsClient)

Types

type BusinessError

type BusinessError struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data"`
}

func NewBusinessError

func NewBusinessError(code int, message string, data interface{}) *BusinessError

func (*BusinessError) Error

func (err *BusinessError) Error() string

func (*BusinessError) WithData

func (be *BusinessError) WithData(data interface{}) *BusinessError

Jump to

Keyboard shortcuts

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