tagger/httptest/stream/stream.go
Matthew Rich 14fda44c41
Some checks failed
Lint / golangci-lint (push) Failing after 10m25s
Declarative Tests / test (push) Failing after 1m59s
add artifacts
2024-04-04 13:37:54 -07:00

29 lines
449 B
Go

// Copyright 2024 Matthew Rich <matthewrich.conf@gmail.com>. All rights reserved.
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),
}
}