Documentation ¶
Overview ¶
Package multiwriter implements a multi-writer
Index ¶
- type DefaultDocumentIOMultiWriter
- func (b *DefaultDocumentIOMultiWriter) AddWriter(writer *io.PipeWriter)
- func (b *DefaultDocumentIOMultiWriter) Close() (err error)
- func (b *DefaultDocumentIOMultiWriter) GetWaitGroup() *sync.WaitGroup
- func (b *DefaultDocumentIOMultiWriter) Write(p []byte) (n int, err error)
- func (b *DefaultDocumentIOMultiWriter) WriteString(message string) (n int, err error)
- type DocumentIOMultiWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DefaultDocumentIOMultiWriter ¶
type DefaultDocumentIOMultiWriter struct {
// contains filtered or unexported fields
}
DefaultDocumentIOMultiWriter is the default implementation of multi-writer.
func NewDocumentIOMultiWriter ¶
func NewDocumentIOMultiWriter() (b *DefaultDocumentIOMultiWriter)
NewDocumentIOMultiWriter creates a new document multi-writer
func (*DefaultDocumentIOMultiWriter) AddWriter ¶
func (b *DefaultDocumentIOMultiWriter) AddWriter(writer *io.PipeWriter)
AddWriter adds a new writer to an existing multi-writer
func (*DefaultDocumentIOMultiWriter) Close ¶
func (b *DefaultDocumentIOMultiWriter) Close() (err error)
Close waits for all the writers to be closed.
func (*DefaultDocumentIOMultiWriter) GetWaitGroup ¶
func (b *DefaultDocumentIOMultiWriter) GetWaitGroup() *sync.WaitGroup
GetStreamClosedChannel adds a new writer to an existing multi-writer
func (*DefaultDocumentIOMultiWriter) Write ¶
func (b *DefaultDocumentIOMultiWriter) Write(p []byte) (n int, err error)
Write is responsible for writing a byte to all the attached pipes.
func (*DefaultDocumentIOMultiWriter) WriteString ¶
func (b *DefaultDocumentIOMultiWriter) WriteString(message string) (n int, err error)
WriteString is responsible for writing a string to all the attached pipes.
type DocumentIOMultiWriter ¶
type DocumentIOMultiWriter interface { AddWriter(*io.PipeWriter) GetWaitGroup() *sync.WaitGroup Write([]byte) (int, error) WriteString(string) (int, error) Close() error }
DocumentIOMultiWriter is a multi-writer with support for close channel. This is responsible for creating a fan-out multi-writer which allows you to duplicate the writes to all the provided writers.