format

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxLimit = 300
)

Variables

This section is empty.

Functions

func DocToMap

func DocToMap(inter interface{}, f ObjToMapFunc) (interface{}, int)

Types

type ObjToMapFunc

type ObjToMapFunc func(i interface{}) map[string]interface{}

type Pagination

type Pagination interface {
	Output(w io.Writer) error
	GetRows() interface{}
	GetAllPages() int64
	GetPage() int64
}

func NewPagination

func NewPagination(
	source PaginationSource,
	limit, page int64,
	format func(i interface{}) map[string]interface{},
) (Pagination, error)

type PaginationSource

type PaginationSource interface {
	Count() (int64, error)
	Data(limit, p int64, format ObjToMapFunc) ([]map[string]interface{}, error)
}

Jump to

Keyboard shortcuts

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