pagination

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractPage

func ExtractPage(c telebot.Context, s *session.Session, key string) uint64

ExtractPage get page from callback or session storage, if not exist, then return 1 and save to session storage. It extract page from callback and session storage and save it to session storage. You can use this function to get page from callback and session storage.

func ExtractPageFromCallback

func ExtractPageFromCallback(c telebot.Context) (uint64, bool)

ExtractPageFromCallback retrieves the page number from the callback data. It parses the callback data as a uint64 and returns the page number along with a boolean indicating success. If the data is empty or cannot be parsed as a valid page number, it returns 0 and false.

func ExtractPageFromSession

func ExtractPageFromSession(s *session.Session, key string) (uint64, bool)

ExtractPageFromSession get page from session storage. It get page from session storage and return false if not exist. Page is saved in session storage with key, for example: "page".

func NewPagination

func NewPagination(unique string, page uint64, pages uint64) []telebot.InlineButton

Types

This section is empty.

Jump to

Keyboard shortcuts

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