Documentation ¶
Index ¶
- Constants
- func ConvertToMap(data interface{}, fields []string, timeFormat string, location *time.Location) ([]map[string]string, error)
- func ExportCsv(ctx context.Context, exportFields []string, separator rune, ...) (resFileName string, resErr error)
- type DataFetcher
- type Task
- type TaskExecutor
- type TaskStatus
Constants ¶
View Source
const ( TaskStatusRunning = iota TaskStatusSucceeded TaskStatusFailed )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DataFetcher ¶
type Task ¶
type Task struct { ExportFields []string Separator rune DataFetcher DataFetcher }
type TaskExecutor ¶
type TaskExecutor interface { // StartExecute creates new export task. StartExecute(ctx context.Context, t Task) (string, error) // Execute receives tasks from channel and save its result to storage. Execute(ctx context.Context) // GetStatus returns export task status. GetStatus(ctx context.Context, id string) (*TaskStatus, error) }
TaskExecutor is used to implement export task executor.
func NewTaskExecutor ¶
func NewTaskExecutor( client mongo.DbClient, logger zerolog.Logger, ) TaskExecutor
type TaskStatus ¶
Click to show internal directories.
Click to hide internal directories.