func NewStreamWatcher(d Decoder, r Reporter) *StreamWatcher {
	sw := &StreamWatcher{
		source:   d,
		reporter: r,
		result: make(chan Event),
		done: make(chan struct{}),
	}
	go sw.receive()
	return sw
}
NewStreamWatcher creates a StreamWatcher from the given decoder.
package watch
import (
	"fmt"
	"io"
	"sync"
	"k8s.io/klog/v2"
	"k8s.io/apimachinery/pkg/runtime"
	"k8s.io/apimachinery/pkg/util/net"
	utilruntime "k8s.io/apimachinery/pkg/util/runtime"
)
type Decoder interface {
	Decode() (action EventType, object runtime.Object, err error)
	Close()
}
type Reporter interface {
	AsObject(err error) runtime.Object
}
type StreamWatcher struct {
	sync.Mutex
	source   Decoder
	reporter Reporter
	result   chan Event
	done     chan struct{}
}