result

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CodeOK      = 0
	CodeUnknown = 1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Code

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

func ErrCode

func ErrCode(code int, desc string) Code

func (Code) Desc

func (c Code) Desc() string

func (Code) Error

func (c Code) Error() string

func (Code) String

func (c Code) String() string

func (Code) Val

func (c Code) Val() int

type Result

type Result interface {
	JSON(w http.ResponseWriter, r *http.Request)
}

Result API结果

func Err

func Err(err error, msg ...string) Result

func OK

func OK(data ...any) Result

Jump to

Keyboard shortcuts

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