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.
24 lines
354 B
24 lines
354 B
package query
|
|
|
|
// Limiter is a filter to limit the result
|
|
type Limiter interface {
|
|
Limit() (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() (limit *int64) {
|
|
|
|
if l <= 0 {
|
|
return
|
|
}
|
|
|
|
limit = new(int64)
|
|
*limit = int64(l)
|
|
|
|
return
|
|
}
|
|
|