gateway

package
v0.0.0-...-0866dc8 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2023 License: MIT Imports: 9 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.Client)

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