apihelpers

package
v0.0.0-...-e1ec090 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2022 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseUnix

func ParseUnix(timestamp string) (time.Time, error)

ParseUnix parse a unix timestamp

Types

type PagedParams

type PagedParams struct {
	Page, Limit int
}

PagedParams is the struct type for the parameters passed into the pagination function

type Paginator

type Paginator struct {
	CurrentPage, PageSize, TotalPages int
	Function                          PaginatorFunction
	SkipFirstPage                     bool
}

Paginator iterates over a given series of pages calling a function each time

func (Paginator) GetAll

func (p Paginator) GetAll()

GetAll gets all remaining pages

func (Paginator) GetAllInParallel

func (p Paginator) GetAllInParallel(parallelization int)

GetAllInParallel gets all remaining pages in parallel batches

func (Paginator) GetAtPage

func (p Paginator) GetAtPage(page int)

func (Paginator) GetNext

func (p Paginator) GetNext()

GetNext gets the current page and increments the current page

type PaginatorFunction

type PaginatorFunction func(PagedParams)

PaginatorFunction is any function that accepts PagedParams and returns a pointer

Jump to

Keyboard shortcuts

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