mirror of
https://github.com/safing/portbase
synced 2025-09-10 15:34:26 +00:00
Finish database queries and subscriptions / Improve Accessor
This commit is contained in:
parent
8c861a1e4f
commit
9ab95b1926
17 changed files with 235 additions and 33 deletions
|
@ -6,9 +6,9 @@ import (
|
|||
|
||||
// Iterator defines the iterator structure.
|
||||
type Iterator struct {
|
||||
Next chan record.Record
|
||||
Done chan struct{}
|
||||
Error error
|
||||
Next chan record.Record
|
||||
Done chan struct{}
|
||||
Err error
|
||||
}
|
||||
|
||||
// New creates a new Iterator.
|
||||
|
@ -18,3 +18,9 @@ func New() *Iterator {
|
|||
Done: make(chan struct{}),
|
||||
}
|
||||
}
|
||||
|
||||
func (it *Iterator) Finish(err error) {
|
||||
close(it.Next)
|
||||
close(it.Done)
|
||||
it.Err = err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue