resp

package module
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPage

func GetPage(c *gin.Context) int

func GetPageOffset

func GetPageOffset(c *gin.Context) (offset, limit int)

func GetPageSize

func GetPageSize(c *gin.Context) int

Types

type Pager

type Pager struct {
	Page      int   `json:"page"`
	PageSize  int   `json:"page_size"`
	TotalRows int64 `json:"total_rows"`
}

type Response

type Response struct {
	Ctx *gin.Context
}

func NewResponse

func NewResponse(ctx *gin.Context) *Response

func (*Response) ToErrorResponse

func (r *Response) ToErrorResponse(err *errcode.Error)

func (*Response) ToResponse

func (r *Response) ToResponse(data interface{})

func (*Response) ToResponseList

func (r *Response) ToResponseList(list interface{}, totalRows int64)

Jump to

Keyboard shortcuts

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