rsp

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2025 License: MIT Imports: 2 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IntX

type IntX interface {
	int | int64 | int32 | int16 | int8 | uint | uint64 | uint32 | uint16 | uint8
}

type Items

type Items struct {
	Items any   `json:"items"`
	Total int64 `json:"total"`
	Ext   any   `json:"ext,omitempty"`
}

type Rsp

type Rsp struct {
	c.APICode
	Data any `json:"data"`
}

func C

func C(code c.APICode) *Rsp

func E

func E(code c.APICode, msg any) *Rsp

func Item

func Item[T IntX](total T, items any) Rsp

func ItemCode

func ItemCode(c code.APICode) Rsp

func ItemExt

func ItemExt[T IntX](total T, items any, ext any) Rsp

func ItemNone

func ItemNone() Rsp

func M

func M(msg string) *Rsp

func MItem

func MItem[T IntX](total T, items any, msg string, ext ...any) Rsp

func New

func New(c int, msg string, data any) *Rsp

func OK

func OK() *Rsp

func S

func S(data any) *Rsp

func SM

func SM(data any, msg string) *Rsp

func UnImplemented

func UnImplemented() *Rsp

func (*Rsp) WithCode

func (r *Rsp) WithCode(code c.APICode) *Rsp

func (*Rsp) WithData

func (r *Rsp) WithData(v any) *Rsp

func (*Rsp) WithItem

func (r *Rsp) WithItem(total int64, items any) *Rsp

func (*Rsp) WithItemExt

func (r *Rsp) WithItemExt(total int64, items any, ext any) *Rsp

func (*Rsp) WithMsg

func (r *Rsp) WithMsg(v string) *Rsp

Jump to

Keyboard shortcuts

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