forked from mtusi2026/mtusi2026lab6
26 lines
482 B
Go
26 lines
482 B
Go
package dto
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
// Page is a page of records with the ID to use for the next page.
|
|
type Page[T any] struct {
|
|
Items []T
|
|
NextCursorID *uuid.UUID
|
|
}
|
|
|
|
// PagePosition is a resolved database cursor, ordered by creation time and ID.
|
|
type PagePosition struct {
|
|
CreatedAt time.Time
|
|
ID uuid.UUID
|
|
}
|
|
|
|
// PageQuery is prepared by a service; Limit includes the lookahead row.
|
|
type PageQuery struct {
|
|
Limit int
|
|
After *PagePosition
|
|
}
|