Documentation ¶
Index ¶
Constants ¶
View Source
const ( TaskStatusRunning = iota TaskStatusSucceeded TaskStatusFailed )
Variables ¶
This section is empty.
Functions ¶
func ToCsv ¶
func ToCsv(ctx context.Context, fsg FieldsSeparatorGetter, dataCursor DataCursor) (resFileName string, resErr error)
ToCsv fetches data and saves it in csv file.
Types ¶
type DataCursor ¶
type Field ¶
type FieldsSeparatorGetter ¶
type OutputFormatter ¶
type OutputFormatter interface { GetFileExtension() string DataFetcher(context.Context, FieldsSeparatorGetter, DataCursor) (string, error) }
type Task ¶
type Task struct { ID string `bson:"_id"` Status int64 `bson:"status"` Type string `bson:"type"` Parameters string `bson:"parameters"` Fields Fields `bson:"fields"` Separator rune `bson:"separator"` File string `bson:"file,omitempty"` Filename string `bson:"filename"` FailReason string `bson:"fail_reason,omitempty"` User string `bson:"user"` Created datetime.CpsTime `bson:"created"` Launched *datetime.CpsTime `bson:"launched,omitempty"` Completed *datetime.CpsTime `bson:"completed,omitempty"` }
type TaskExecutor ¶
type TaskExecutor interface { RegisterType(t string, fetch FetchData) // Execute receives tasks from channel and save its result to storage. Execute(ctx context.Context) // StartExecute creates new export task. StartExecute(ctx context.Context, t TaskParameters) (*Task, error) Get(ctx context.Context, id string) (*Task, error) SetFormatter(t string, f OutputFormatter) }
TaskExecutor is used to implement export task executor.
func NewTaskExecutor ¶
func NewTaskExecutor( client mongo.DbClient, timezoneConfigProvider config.TimezoneConfigProvider, logger zerolog.Logger, ) TaskExecutor
Click to show internal directories.
Click to hide internal directories.