Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var TimeoutErr = fmt.Errorf("writer closed due to timeout")
Functions ¶
This section is empty.
Types ¶
type SafeWriter ¶
SafeWriter provides a thread-safe io.Writer
func (*SafeWriter) SetWriter ¶
func (s *SafeWriter) SetWriter(w io.Writer)
type TimeoutWriter ¶
type TimeoutWriter struct {
// contains filtered or unexported fields
}
TimeoutWriter accepts input until expiration, then returns errors.
An error will be written to the wrapped writer unless `Finished` is called before the timeout.
func NewTimeoutWriter ¶
func NewTimeoutWriter(w io.Writer, patience time.Duration) *TimeoutWriter
func NewTimeoutWriterFromChan ¶
func NewTimeoutWriterFromChan(w io.Writer, done <-chan time.Time) *TimeoutWriter
func (*TimeoutWriter) Finished ¶
func (w *TimeoutWriter) Finished()
Click to show internal directories.
Click to hide internal directories.