github.com/yandex/pandora@v0.5.32/core/datasink/std.go (about) 1 package datasink 2 3 import ( 4 "bytes" 5 "io" 6 7 "github.com/yandex/pandora/core" 8 "github.com/yandex/pandora/lib/ioutil2" 9 ) 10 11 type Buffer struct { 12 bytes.Buffer 13 ioutil2.NopCloser 14 } 15 16 var _ core.DataSink = &Buffer{} 17 18 func (b *Buffer) OpenSink() (wc io.WriteCloser, err error) { 19 return b, nil 20 } 21 22 func NewBuffer() *Buffer { 23 return &Buffer{} 24 }