17
ok bool,
18
reservations []Reservation,
20
>
if ok && len(reservations) == 0 {
21
panic("expect at least one reservation")
22
}
24
>
ok: ok,
25
>
reservations: reservations,
26
>
}
27
}
28
29
// OK returns whether the limiter can provide the requested number of tokens
31
>
return r.ok
32
>
}
33
34
// Cancel indicates that the reservation holder will not perform the reserved action