Documentation
¶
Index ¶
Constants ¶
View Source
const ( // Default number of pages DefaultPerPage = 20 // Default page number DefaultPage = 1 )
Variables ¶
This section is empty.
Functions ¶
func FromJSONBase64 ¶
Decode encodeStr using base64, and then use json to convert to obj.
func Paginate ¶
This function implements the paging of List, inputting the total number of data (usually the length of Slice), the number of each page, and the page number. The function guarantees that Begin and End do not exceed the total number of data.
If input perPage is less than 1, it will be set as DefaultPerPage. If input page is less than 1, it will be set as DefaultPage.
Returns the start and end position of the pagination.
func ToJSONBase64 ¶
Convert obj to json string, and then encode it with base64.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.