tagger/httptest/stream/stream.go

29 lines
449 B
Go
Raw Normal View History

2024-04-04 20:37:54 +00:00
// Copyright 2024 Matthew Rich <matthewrich.conf@gmail.com>. All rights reserved.
2024-04-04 20:30:41 +00:00
package stream
import (
"net/http/httptest"
)
type Recorder struct {
*httptest.ResponseRecorder
closeStream chan bool
}
func (r *Recorder) CloseNotify() <-chan bool {
return r.closeStream
}
func (r *Recorder) Close() {
r.closeStream <- true
}
func NewRecorder() *Recorder{
return &Recorder{
httptest.NewRecorder(),
make(chan bool),
}
}