New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

vimagination.zapto.org/pagination

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vimagination.zapto.org/pagination

  • v0.0.0-20240819164649-b843b553302c
  • Go
  • Socket score

Version published
Created
Source

pagination

-- import "vimagination.zapto.org/pagination"

Package pagination implements a pagination solution for multiple front-ends.

Usage

type Config
type Config struct {
	Ends, Surrounding uint
}

Config is the configuration for a Pagination.

func New
func New() Config

New returns a default configuration for Pagination.

func (Config) Get
func (c Config) Get(currPage, lastPage uint) Pagination

Get returns the Section information for Pagination.

type Pagination
type Pagination struct {
}

Pagination contains the information necessary to print a proper pagination.

func (Pagination) HTML
func (p Pagination) HTML(urlBase string) string

HTML calls Print with a HTML based pageFn and a simple ellipses.

The urlBase will have the page number appended to it, so it needs to be formatted with this in mind.

func (Pagination) Print
func (p Pagination) Print(pageFn func(uint) string, sep string) string

Print converts the Pagination sections into a string.

The pageFn func takes a page number and returns whatever text is needed for that page.

The sep string is what is to appear between the sections.

func (Pagination) String
func (p Pagination) String() string

String stringifies the Sections with a simple pageFn.

FAQs

Package last updated on 19 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc