github.com/yandex/pandora@v0.5.32/core/coreutil/data.go (about)

     1  package coreutil
     2  
     3  import (
     4  	"io"
     5  
     6  	"github.com/yandex/pandora/core"
     7  )
     8  
     9  type DataSinkFunc func() (wc io.WriteCloser, err error)
    10  
    11  func (f DataSinkFunc) OpenSink() (wc io.WriteCloser, err error) {
    12  	return f()
    13  }
    14  
    15  var _ core.DataSink = DataSinkFunc(nil)
    16  
    17  type DataSourceFunc func() (wc io.ReadCloser, err error)
    18  
    19  func (f DataSourceFunc) OpenSource() (rc io.ReadCloser, err error) {
    20  	return f()
    21  }
    22  
    23  var _ core.DataSource = DataSourceFunc(nil)