response

package
v0.0.0-...-54cbf26 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2024 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     int32  `json:"code"`
	Message  string `json:"message,omitempty"`
	Data     any    `json:"data,omitempty"`
	Error    any    `json:"error,omitempty"`
	HttpCode int    `json:"-"`
	// contains filtered or unexported fields
}

func Result

func Result(code int32, data any, options ...ResponseResultOptions) *Response

func ResultFail

func ResultFail(code int32, msg any, options ...ResponseResultOptions) *Response

type ResponseResultOptions

type ResponseResultOptions func(response *Response)

func ResultWithData

func ResultWithData(data any) ResponseResultOptions

func ResultWithError

func ResultWithError(error any) ResponseResultOptions

func ResultWithHttpCode

func ResultWithHttpCode(code int) ResponseResultOptions

func ResultWithMsg

func ResultWithMsg(msg any) ResponseResultOptions

Jump to

Keyboard shortcuts

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