You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mongox-go-driver/mongox/query/limit.go

23 lines
326 B

package query
// Limiter is a filter to limit the result
type Limiter interface {
Limit() *int64
}
// Limit is a simple implementation of the Limiter filter
type Limit int64
var _ Limiter = Limit(0)
// Limit returns a limit
func (l Limit) Limit() *int64 {
lim := int64(l)
if lim <= 0 {
return nil
}
return &lim
}