1package mock 2 3import ( 4 "context" 5 6 "github.com/influxdata/flux/memory" 7 "github.com/influxdata/influxdb/coordinator" 8 "github.com/influxdata/influxdb/flux/stdlib/influxdata/influxdb" 9) 10 11// Reader is a mock implementation of flux/stdlib/influxdata/influxdb.Reader 12type Reader struct { 13 ReadFilterFn func(ctx context.Context, spec influxdb.ReadFilterSpec, alloc *memory.Allocator) (influxdb.TableIterator, error) 14 ReadGroupFn func(ctx context.Context, spec influxdb.ReadGroupSpec, alloc *memory.Allocator) (influxdb.TableIterator, error) 15 ReadTagKeysFn func(ctx context.Context, spec influxdb.ReadTagKeysSpec, alloc *memory.Allocator) (influxdb.TableIterator, error) 16 ReadTagValuesFn func(ctx context.Context, spec influxdb.ReadTagValuesSpec, alloc *memory.Allocator) (influxdb.TableIterator, error) 17 ReadWindowAggregateFn func(ctx context.Context, spec influxdb.ReadWindowAggregateSpec, alloc *memory.Allocator) (influxdb.TableIterator, error) 18 CloseFn func() 19} 20 21func (m Reader) ReadFilter(ctx context.Context, spec influxdb.ReadFilterSpec, alloc *memory.Allocator) (influxdb.TableIterator, error) { 22 return m.ReadFilterFn(ctx, spec, alloc) 23} 24 25func (m Reader) ReadGroup(ctx context.Context, spec influxdb.ReadGroupSpec, alloc *memory.Allocator) (influxdb.TableIterator, error) { 26 return m.ReadGroupFn(ctx, spec, alloc) 27} 28 29func (m Reader) ReadWindowAggregate(ctx context.Context, spec influxdb.ReadWindowAggregateSpec, alloc *memory.Allocator) (influxdb.TableIterator, error) { 30 return m.ReadWindowAggregateFn(ctx, spec, alloc) 31} 32 33func (m Reader) ReadTagKeys(ctx context.Context, spec influxdb.ReadTagKeysSpec, alloc *memory.Allocator) (influxdb.TableIterator, error) { 34 return m.ReadTagKeysFn(ctx, spec, alloc) 35} 36 37func (m Reader) ReadTagValues(ctx context.Context, spec influxdb.ReadTagValuesSpec, alloc *memory.Allocator) (influxdb.TableIterator, error) { 38 return m.ReadTagValuesFn(ctx, spec, alloc) 39} 40 41func (m Reader) Close() { 42 m.CloseFn() 43} 44 45type Writer struct { 46} 47 48func (w *Writer) WritePointsInto(request *coordinator.IntoWriteRequest) error { 49 panic("not implemented") 50} 51