[#165] Add stream listing tests

Signed-off-by: Denis Kirillov <d.kirillov@yadro.com>
This commit is contained in:
Denis Kirillov 2024-01-19 12:53:53 +03:00
parent cf4fc3b602
commit 093de13f54
6 changed files with 189 additions and 186 deletions

View file

@ -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
}