pagination

package
v0.1.21 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: MIT Imports: 1 Imported by: 1

Documentation

Overview

Package pagination implements the functions, types, and interfaces for the module.

Package pagination implements the functions, types, and interfaces for the module.

Index

Constants

View Source
const (
	DefaultPage     = 1
	DefaultPageSize = 15
	MaxPage         = 100
	MaxPageSize     = 1000
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CurrentGetter added in v0.1.0

type CurrentGetter interface {
	GetCurrent() int32
}

CurrentGetter is the interface for getting the current page number.

type DataGetter added in v0.1.0

type DataGetter interface {
	GetData() any
}

DataGetter is the interface for getting the data.

type ExtraGetter added in v0.1.0

type ExtraGetter interface {
	GetExtra() any
}

ExtraGetter is the interface for getting the extra data.

type FieldMaskGetter added in v0.1.0

type FieldMaskGetter interface {
	GetFieldMask() []string
}

FieldMaskGetter is the interface for getting the field mask.

type Limiter added in v0.1.0

type Limiter struct {
	MaxPage         int32
	DefaultPage     int32
	MaxPageSize     int32
	DefaultPageSize int32
}

func DefaultLimiter added in v0.1.0

func DefaultLimiter() Limiter

func NewLimiter added in v0.1.0

func NewLimiter(page, defaultPage, pageSize, defaultPageSize int32) Limiter

func (Limiter) Current added in v0.1.0

func (obj Limiter) Current(in int32) int32

func (Limiter) PerPage added in v0.1.0

func (obj Limiter) PerPage(in int32) int32

type NextPageTokenGetter added in v0.1.0

type NextPageTokenGetter interface {
	GetNextPageToken() string
}

NextPageTokenGetter is the interface for getting the next page token.

type NoPagingGetter added in v0.1.0

type NoPagingGetter interface {
	GetNoPaging() bool
}

NoPagingGetter is the interface for checking if no paging is needed.

type OnlyCountGetter added in v0.1.0

type OnlyCountGetter interface {
	GetOnlyCount() bool
}

OnlyCountGetter is the interface for checking if only count is needed.

type OrderByGetter added in v0.1.0

type OrderByGetter interface {
	GetOrderBy() []string
}

OrderByGetter is the interface for getting the order by fields.

type PageLimiter added in v0.1.0

type PageLimiter interface {
	Current(in int32) int32
	PerPage(in int32) int32
}

type PageSizeGetter added in v0.1.0

type PageSizeGetter interface {
	GetPageSize() int32
}

PageSizeGetter is the interface for getting the page size.

type PageTokenGetter added in v0.1.0

type PageTokenGetter interface {
	GetPageToken() string
}

PageTokenGetter is the interface for getting the page token.

type Requester

Requester is the request interface for the module.

type Responder

Responder is the response interface for the module.

type SuccessGetter added in v0.1.0

type SuccessGetter interface {
	GetSuccess() bool
}

SuccessGetter is the interface for getting the success status.

type TotalGetter added in v0.1.0

type TotalGetter interface {
	GetTotal() int32
}

TotalGetter is the interface for getting the total count.

type UnimplementedRequester

type UnimplementedRequester struct{}

UnimplementedRequester is a struct that implements the Requester interface with empty methods.

func (UnimplementedRequester) GetCurrent

func (u UnimplementedRequester) GetCurrent() int32

GetCurrent returns the current page number.

func (UnimplementedRequester) GetFieldMask

func (u UnimplementedRequester) GetFieldMask() []string

GetFieldMask returns the field mask.

func (UnimplementedRequester) GetNoPaging

func (u UnimplementedRequester) GetNoPaging() bool

GetNoPaging returns a boolean indicating whether to disable paging.

func (UnimplementedRequester) GetOnlyCount

func (u UnimplementedRequester) GetOnlyCount() bool

GetOnlyCount returns a boolean indicating whether to only return the count.

func (UnimplementedRequester) GetOrderBy

func (u UnimplementedRequester) GetOrderBy() []string

GetOrderBy returns the order by fields.

func (UnimplementedRequester) GetPageSize

func (u UnimplementedRequester) GetPageSize() int32

GetPageSize returns the page size.

func (UnimplementedRequester) GetPageToken

func (u UnimplementedRequester) GetPageToken() string

GetPageToken returns the page token.

type UnimplementedResponder

type UnimplementedResponder struct{}

UnimplementedResponder is a struct that implements the Responder interface with empty methods.

func (UnimplementedResponder) GetCurrent

func (u UnimplementedResponder) GetCurrent() int32

GetCurrent returns the current page number.

func (UnimplementedResponder) GetData

func (u UnimplementedResponder) GetData() any

GetData returns the data.

func (UnimplementedResponder) GetExtra

func (u UnimplementedResponder) GetExtra() any

GetExtra returns any extra data.

func (UnimplementedResponder) GetNextPageToken

func (u UnimplementedResponder) GetNextPageToken() string

GetNextPageToken returns the next page token.

func (UnimplementedResponder) GetPageSize

func (u UnimplementedResponder) GetPageSize() int32

GetPageSize returns the page size.

func (UnimplementedResponder) GetSuccess

func (u UnimplementedResponder) GetSuccess() bool

GetSuccess returns a boolean indicating whether the request was successful.

func (UnimplementedResponder) GetTotal

func (u UnimplementedResponder) GetTotal() int32

GetTotal returns the total number of items.

Jump to

Keyboard shortcuts

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