restjson

package
v0.10.5 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PagingData

type PagingData struct {
	*utils.Pagination
	Total int64       `json:"total"`
	Data  interface{} `json:"data"`
}

type Response

type Response[T any] struct {
	Code string `json:"code"`
	Data *T     `json:"data"`
	Msg  string `json:"msg"`
}

func ErrorResJson

func ErrorResJson(code string, errMsg string) Response[any]

func ErrorResJsonWithError added in v0.10.5

func ErrorResJsonWithError(ctx iris.Context, err error) Response[any]

func ErrorResJsonWithMsg

func ErrorResJsonWithMsg(errMsg string) Response[any]

func ResJson

func ResJson[T any](code string, data *T, msg string) Response[T]

func SuccessResJson

func SuccessResJson() Response[any]

func SuccessResJsonWithData

func SuccessResJsonWithData[T any](data *T) Response[T]

func SuccessResJsonWithPagingData

func SuccessResJsonWithPagingData(data *PagingData) Response[PagingData]

Jump to

Keyboard shortcuts

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