response

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BadRequest

func BadRequest(c *fiber.Ctx, err *gerror.Error) error

func Created

func Created(c *fiber.Ctx, content any) error

func Forbidden

func Forbidden(c *fiber.Ctx, err *gerror.Error) error

func InternalServerError

func InternalServerError(c *fiber.Ctx, err *gerror.Error) error

func NotAllowed

func NotAllowed(c *fiber.Ctx, err *gerror.Error) error

func NotFound

func NotFound(c *fiber.Ctx, err *gerror.Error) error

func NotImplemented

func NotImplemented(c *fiber.Ctx) error

func OK

func OK(c *fiber.Ctx, content any) error

func Unauthorized

func Unauthorized(c *fiber.Ctx, err *gerror.Error) error

Types

type Api

type Api[CType any] struct {
	Code    int           `json:"code"`
	Content CType         `json:"content"`
	Error   *gerror.Error `json:"error"`
}

type ListRequest

type ListRequest struct {
	Page     int            `json:"page"`
	PageSize int            `json:"pageSize"`
	Filters  map[string]any `json:"filters"`
	Aggs     map[string]any `json:"aggs"`
}

func ListRequestLastDay

func ListRequestLastDay() ListRequest

func ListRequestLastMonth

func ListRequestLastMonth() ListRequest

func ListRequestLastYear

func ListRequestLastYear() ListRequest

type ListResponse

type ListResponse[CType any] struct {
	List     []CType `json:"list"`
	Page     int     `json:"page"`
	PageSize int     `json:"pageSize"`
	Total    int64   `json:"total"`
}

type Ok

type Ok struct {
	IsOk bool `json:"isOk"`
}

type Response

type Response struct {
	Code    int           `json:"code"`
	Content any           `json:"content"`
	Error   *gerror.Error `json:"error"`
}

type Str

type Str struct {
	Value string `json:"value"`
}

Jump to

Keyboard shortcuts

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