Documentation
¶
Overview ¶
Package exportcallback provides callback-based row sources.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FuncIterator ¶
type FuncIterator struct {
NextFunc IteratorFunc
CloseFunc func() error
}
FuncIterator wraps a function into a RowIterator.
func (*FuncIterator) Close ¶
func (it *FuncIterator) Close() error
type IteratorFunc ¶
IteratorFunc yields a row or io.EOF.
type Source ¶
type Source struct {
// contains filtered or unexported fields
}
Source wraps a callback function as a RowSource.
func NewSource ¶
func NewSource(fn SourceFunc) *Source
NewSource creates a callback-based RowSource.
func (*Source) Open ¶
func (s *Source) Open(ctx context.Context, spec export.RowSourceSpec) (export.RowIterator, error)
Open delegates to the configured callback.
type SourceFunc ¶
type SourceFunc func(ctx context.Context, spec export.RowSourceSpec) (export.RowIterator, error)
SourceFunc builds a RowIterator for a request.
Click to show internal directories.
Click to hide internal directories.