paginator

package module
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

README

this package is for paginating your request

you can use GetPaginatedResponse(data , pageSize , currentPage) to get a json string

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPaginatedResponse

func GetPaginatedResponse(data []interface{}, pageSize int, currentPage int) (string, error)

func MarshalToString

func MarshalToString(v interface{}) (string, error)

Types

type Meta

type Meta struct {
	PerPage     int    `json:"per_page"`
	CurrentPage int    `json:"current_page"`
	LastPage    int    `json:"last_page"`
	From        *int   `json:"from"`
	To          *int   `json:"to"`
	Path        string `json:"path"`
	Total       int    `json:"total"`
}

Jump to

Keyboard shortcuts

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