Documentation
¶
Index ¶
- func BatchDownload(cfg *iqshell.Config, info BatchDownloadInfo)
- func BatchDownloadWithConfig(cfg *iqshell.Config, info BatchDownloadWithConfigInfo)
- func DownloadFile(cfg *iqshell.Config, info DownloadInfo)
- func NewWorkProvider(bucket, keyPrefix, inputFile, itemSeparate string, ...) flow.WorkProvider
- type BatchDownloadInfo
- type BatchDownloadWithConfigInfo
- type DownloadCfg
- type DownloadInfo
- type Metric
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BatchDownload ¶
func BatchDownload(cfg *iqshell.Config, info BatchDownloadInfo)
func BatchDownloadWithConfig ¶
func BatchDownloadWithConfig(cfg *iqshell.Config, info BatchDownloadWithConfigInfo)
func DownloadFile ¶
func DownloadFile(cfg *iqshell.Config, info DownloadInfo)
func NewWorkProvider ¶
func NewWorkProvider(bucket, keyPrefix, inputFile, itemSeparate string, infoResetHandler apiInfoResetHandler) flow.WorkProvider
Types ¶
type BatchDownloadInfo ¶
type BatchDownloadInfo struct {
flow.Info
export.FileExporterConfig
DownloadCfg
// 工作数据源
InputFile string // 工作数据源:文件
ItemSeparate string // 工作数据源:每行元素按分隔符分的分隔符
}
func (*BatchDownloadInfo) Check ¶
func (info *BatchDownloadInfo) Check() *data.CodeError
type BatchDownloadWithConfigInfo ¶
type BatchDownloadWithConfigInfo struct {
flow.Info
export.FileExporterConfig
// 工作数据源
InputFile string // 工作数据源:文件
ItemSeparate string // 工作数据源:每行元素按分隔符分的分隔符
LocalDownloadConfig string
}
func (*BatchDownloadWithConfigInfo) Check ¶
func (info *BatchDownloadWithConfigInfo) Check() *data.CodeError
type DownloadCfg ¶
type DownloadCfg struct {
FileEncoding string `json:"file_encoding,omitempty"`
KeyFile string `json:"key_file,omitempty"`
DestDir string `json:"dest_dir,omitempty"`
Bucket string `json:"bucket,omitempty"`
Prefix string `json:"prefix,omitempty"`
SavePathHandler string `json:"save_path_handler"`
Suffixes string `json:"suffixes,omitempty"`
IoHost string `json:"io_host,omitempty"`
Public bool `json:"public,omitempty"`
CheckSize bool `json:"check_size,omitempty"`
CheckHash bool `json:"check_hash,omitempty"`
EnableSlice bool `json:"enable_slice"`
SliceFileSizeThreshold int64 `json:"slice_file_size_threshold"`
SliceSize int64 `json:"slice_size"`
SliceConcurrentCount int `json:"slice_concurrent_count"`
//down from cdn
Referer string `json:"referer,omitempty"`
CdnDomain string `json:"cdn_domain,omitempty"` // 废弃
Domain string `json:"domain,omitempty"`
// 是否使用 getfile api,私有云使用
GetFileApi bool `json:"get_file_api"`
// 当遇到错误时删除临时文件
RemoveTempWhileError bool `json:"remove_temp_while_error"`
// 下载状态保存路径
RecordRoot string `json:"record_root,omitempty"`
}
func DefaultDownloadCfg ¶
func DefaultDownloadCfg() DownloadCfg
func (*DownloadCfg) Check ¶
func (d *DownloadCfg) Check() *data.CodeError
func (*DownloadCfg) JobId ¶
func (d *DownloadCfg) JobId() string
type DownloadInfo ¶
type DownloadInfo struct {
Bucket string // 文件被保存的 bucket
Key string // 文件被保存的 key
ToFile string // 文件保存的路径
UseGetFileApi bool //
IsPublic bool //
CheckSize bool // 是否检测文件大小
CheckHash bool // 是否检测文件 hash
Domain string // 下载的 domain
RemoveTempWhileError bool //
EnableSlice bool // 允许切片下载
SliceFileSizeThreshold int64 // 允许切片下载,切片下载出发的文件大小阈值,考虑到不希望所有文件都使用切片下载的场景
SliceSize int64 // 允许切片下载,切片的大小
SliceConcurrentCount int // 允许切片下载,并发下载切片的个数
}
func (*DownloadInfo) Check ¶
func (info *DownloadInfo) Check() *data.CodeError
type Metric ¶ added in v2.8.0
type Metric struct {
batch.Metric
ExistCount int64 `json:"exist_count"`
UpdateCount int64 `json:"update_count"`
}
func (*Metric) AddExistCount ¶ added in v2.8.0
func (*Metric) AddUpdateCount ¶ added in v2.8.0
Click to show internal directories.
Click to hide internal directories.