Пример #1
0
func (f FakeStore) EntriesByOwner(
	t db.Transaction, owner int64, consumer functional.Consumer) error {
	s := functional.NewStreamFromPtrs(f, nil)
	s = functional.Filter(functional.NewFilterer(func(ptr interface{}) error {
		p := ptr.(*vsafe.Entry)
		if p.Owner == owner {
			return nil
		}
		return functional.Skipped
	}),
		s)
	return consumer.Consume(s)
}
Пример #2
0
func (r *filterR) ForTime(t time.Time) functional.Stream {
	result := r.recurring.ForTime(t)
	return functional.Filter(r.filter, result)
}
Пример #3
0
func (r *afterR) ForTime(t time.Time) functional.Stream {
	return functional.Filter(r, r.recurring.ForTime(t.Add(-1*r.after)))
}