response

package
v0.0.0-...-579d35e Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2024 License: Apache-2.0 Imports: 4 Imported by: 21

Documentation

Index

Constants

View Source
const (
	ResponseResultSuccess = "success"
	ResponseResultError   = "error"
	ResponseResultWarning = "warning"
)

Variables

This section is empty.

Functions

func JSON

func JSON(rw http.ResponseWriter, code int, result interface{}, message string)

func JSONString

func JSONString(code int, result interface{}, message string) string

Types

type ResponsePaginationResult

type ResponsePaginationResult struct {
	Total int64       `json:"total"`
	Items interface{} `json:"items"`
}

type ResponseResult

type ResponseResult struct {
	Code    int         `json:"code"`
	Type    string      `json:"type"`
	Message string      `json:"message,omitempty"`
	Url     string      `json:"url,omitempty"`
	Result  interface{} `json:"result,omitempty"`
}

Jump to

Keyboard shortcuts

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