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
- type CurrentGetter
- type DataGetter
- type ExtraGetter
- type FieldMaskGetter
- type Limiter
- type NextPageTokenGetter
- type NoPagingGetter
- type OnlyCountGetter
- type OrderByGetter
- type PageLimiter
- type PageSizeGetter
- type PageTokenGetter
- type Requester
- type Responder
- type SuccessGetter
- type TotalGetter
- type UnimplementedRequester
- func (u UnimplementedRequester) GetCurrent() int32
- func (u UnimplementedRequester) GetFieldMask() []string
- func (u UnimplementedRequester) GetNoPaging() bool
- func (u UnimplementedRequester) GetOnlyCount() bool
- func (u UnimplementedRequester) GetOrderBy() []string
- func (u UnimplementedRequester) GetPageSize() int32
- func (u UnimplementedRequester) GetPageToken() string
- type UnimplementedResponder
- func (u UnimplementedResponder) GetCurrent() int32
- func (u UnimplementedResponder) GetData() any
- func (u UnimplementedResponder) GetExtra() any
- func (u UnimplementedResponder) GetNextPageToken() string
- func (u UnimplementedResponder) GetPageSize() int32
- func (u UnimplementedResponder) GetSuccess() bool
- func (u UnimplementedResponder) GetTotal() int32
Constants ¶
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
func DefaultLimiter ¶ added in v0.1.0
func DefaultLimiter() Limiter
func NewLimiter ¶ added in v0.1.0
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 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 ¶
type Requester interface { CurrentGetter PageSizeGetter PageTokenGetter OnlyCountGetter NoPagingGetter OrderByGetter FieldMaskGetter }
Requester is the request interface for the module.
type Responder ¶
type Responder interface { SuccessGetter TotalGetter DataGetter CurrentGetter PageSizeGetter NextPageTokenGetter ExtraGetter }
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.