response

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2026 License: MIT Imports: 2 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 {
	Message string              `json:"message"`
	Code    int                 `json:"code"`
	Data    any                 `json:"data"`
	Writer  http.ResponseWriter `json:"-"`
	// contains filtered or unexported fields
}

Response HTTP响应封装

func NewResponse

func NewResponse(w http.ResponseWriter) *Response

func (*Response) SetCode

func (r *Response) SetCode(code int) *Response

func (*Response) SetData

func (r *Response) SetData(data any) *Response

func (*Response) SetMessage

func (r *Response) SetMessage(message string) *Response

func (*Response) Write

func (r *Response) Write()

Jump to

Keyboard shortcuts

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