pagination

package
v0.0.0-...-77d0bba Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2018 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

paging package contains common pagination structures and functions

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ByOffset

type ByOffset struct {
	Offset uint64 `form:"offset"`
	Limit  uint64 `form:"-"`
}

ByOffset options to paginate by offset

type ByPageNum

type ByPageNum struct {
	Page    uint64 `form:"page"`
	PerPage uint64 `form:"per_page"`
}

ByPageNum options to paginate by page num

type Metadata

type Metadata struct {
	IsFirst     bool   `json:"is_first"`
	IsLast      bool   `json:"is_last"`
	HasNext     bool   `json:"has_next"`
	HasPrevious bool   `json:"has_previous"`
	Page        uint64 `json:"page"`
	Total       uint64 `json:"total"`
}

Metadata is a struct that represents a Metadata in both database and HTTP APIs

Jump to

Keyboard shortcuts

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