[#165] Add stream listing tests
Signed-off-by: Denis Kirillov <d.kirillov@yadro.com>
This commit is contained in:
parent
cf4fc3b602
commit
093de13f54
6 changed files with 189 additions and 186 deletions
|
@ -2,17 +2,18 @@ package data
|
|||
|
||||
import (
|
||||
"context"
|
||||
"sync/atomic"
|
||||
)
|
||||
|
||||
type VersionsStream interface {
|
||||
Next(ctx context.Context) (*NodeVersion, error)
|
||||
}
|
||||
|
||||
// todo consider thread safe
|
||||
type ListSession struct {
|
||||
Next []*NodeVersion
|
||||
Stream VersionsStream
|
||||
NamesMap map[string]struct{}
|
||||
Context context.Context
|
||||
Cancel context.CancelFunc
|
||||
Acquired atomic.Bool
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue