示例#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
文件: recurring.go 项目: keep94/tasks
func (r *filterR) ForTime(t time.Time) functional.Stream {
	result := r.recurring.ForTime(t)
	return functional.Filter(r.filter, result)
}
示例#3
0
文件: recurring.go 项目: keep94/tasks
func (r *afterR) ForTime(t time.Time) functional.Stream {
	return functional.Filter(r, r.recurring.ForTime(t.Add(-1*r.after)))
}