Files
mtusi2026lab2/service/internal/dto/page.go
T
2026-11-05 14:24:40 +03:00

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
}