pagination

package
v0.0.0-...-6ce63f4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_dbx_pagination_pagination_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Pagination

type Pagination struct {

	// @desc: current page
	Page uint32 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"`
	// @desc: page size
	Size uint32 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"`
	// @desc: total number of data
	Total uint32 `protobuf:"varint,3,opt,name=total,proto3" json:"total,omitempty"`
	// @desc: When SkipCount is true,
	// even if CurrentPage is equal to 1, don't count the total.
	SkipCount bool `protobuf:"varint,4,opt,name=skip_count,json=skipCount,proto3" json:"skip_count,omitempty"`
	// contains filtered or unexported fields
}

Classic pagination mode. Use "Page" and "Size" for pagination.

func NewDefaultPagination

func NewDefaultPagination() *Pagination

func (*Pagination) Descriptor deprecated

func (*Pagination) Descriptor() ([]byte, []int)

Deprecated: Use Pagination.ProtoReflect.Descriptor instead.

func (*Pagination) GetPage

func (x *Pagination) GetPage() uint32

func (*Pagination) GetSize

func (x *Pagination) GetSize() uint32

func (*Pagination) GetSkipCount

func (x *Pagination) GetSkipCount() bool

func (*Pagination) GetTotal

func (x *Pagination) GetTotal() uint32

func (*Pagination) Offset

func (x *Pagination) Offset() int

func (*Pagination) ProtoMessage

func (*Pagination) ProtoMessage()

func (*Pagination) ProtoReflect

func (x *Pagination) ProtoReflect() protoreflect.Message

func (*Pagination) Reset

func (x *Pagination) Reset()

func (*Pagination) SetNextPage

func (x *Pagination) SetNextPage() (ok bool)

SetNextPage If it is the last page, return false

func (*Pagination) SetPage

func (x *Pagination) SetPage(page uint32) *Pagination

SetPage method set current page

func (*Pagination) SetPageAndSize

func (x *Pagination) SetPageAndSize(page, size uint32) *Pagination

func (*Pagination) SetSize

func (x *Pagination) SetSize(size uint32) *Pagination

func (*Pagination) SetSkipCount

func (x *Pagination) SetSkipCount() *Pagination

func (*Pagination) String

func (x *Pagination) String() string

type Scroll

type Scroll struct {

	// @desc: page size
	Size uint32 `protobuf:"varint,1,opt,name=size,proto3" json:"size,omitempty"`
	// @desc: next page token
	Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"`
	// @desc: token expire time
	Expire uint32 `protobuf:"varint,3,opt,name=expire,proto3" json:"expire,omitempty"`
	// contains filtered or unexported fields
}

Scroll: mode. Do not count the total, Use "Size" and "NextToken" for pagination.

through the "NextToken" keep getting the next page until the data is finished.

func (*Scroll) Descriptor deprecated

func (*Scroll) Descriptor() ([]byte, []int)

Deprecated: Use Scroll.ProtoReflect.Descriptor instead.

func (*Scroll) GetExpire

func (x *Scroll) GetExpire() uint32

func (*Scroll) GetSize

func (x *Scroll) GetSize() uint32

func (*Scroll) GetToken

func (x *Scroll) GetToken() string

func (*Scroll) ProtoMessage

func (*Scroll) ProtoMessage()

func (*Scroll) ProtoReflect

func (x *Scroll) ProtoReflect() protoreflect.Message

func (*Scroll) Reset

func (x *Scroll) Reset()

func (*Scroll) SetSize

func (x *Scroll) SetSize(size uint32) *Scroll

func (*Scroll) SetToken

func (x *Scroll) SetToken(token string) *Scroll

func (*Scroll) String

func (x *Scroll) String() string

Jump to

Keyboard shortcuts

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