common

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Response

type Response struct {
	Code    string      `json:"code"`
	Data    interface{} `json:"data"`
	Success bool        `json:"success"`
	Message string      `json:"message"`
}

func NewErrorResponse

func NewErrorResponse(err error) *Response

func NewErrorResponseWithCode added in v1.9.0

func NewErrorResponseWithCode(message string, code string) *Response

NewErrorResponseWithCode 创建包含自定义错误码的错误响应

func NewSuccessResponse

func NewSuccessResponse(data interface{}) *Response

Jump to

Keyboard shortcuts

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