2024-03-22 18:05:47 +08:00
|
|
|
package interfaces
|
|
|
|
|
2024-05-20 16:11:50 +08:00
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"github.com/loveuer/esgo2dump/model"
|
|
|
|
)
|
2024-03-22 18:05:47 +08:00
|
|
|
|
|
|
|
type DumpIO interface {
|
2024-05-20 16:11:50 +08:00
|
|
|
ReadData(ctx context.Context, size int, query map[string]any, includeFields []string) (<-chan []*model.ESSource, <-chan error)
|
2024-05-24 17:27:52 +08:00
|
|
|
WriteData(ctx context.Context, docsCh <-chan []*model.ESSource) error
|
2024-03-27 17:44:01 +08:00
|
|
|
|
2024-03-22 18:05:47 +08:00
|
|
|
ReadMapping(context.Context) (map[string]any, error)
|
|
|
|
WriteMapping(context.Context, map[string]any) error
|
|
|
|
|
|
|
|
ReadSetting(ctx context.Context) (map[string]any, error)
|
|
|
|
WriteSetting(context.Context, map[string]any) error
|
|
|
|
|
|
|
|
Close() error
|
|
|
|
|
|
|
|
IOType() IO
|
|
|
|
IsFile() bool
|
|
|
|
}
|