operations

package
v2.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 5, 2022 License: MIT Imports: 21 Imported by: 0

Documentation

Index

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 string, inputFile string, itemSeparate string) 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

type DownloadCfg

type DownloadCfg struct {
	ThreadCount     int    `json:"thread_count,omitempty"`
	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"`
	CheckHash       bool   `json:"check_hash,omitempty"`

	//down from cdn
	Referer   string `json:"referer,omitempty"`
	CdnDomain string `json:"cdn_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   //
	CheckHash            bool   // 是否检测文件 hash
	Domain               string // 下载的 domain
	RemoveTempWhileError bool   //
}

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 (m *Metric) AddExistCount(count int64)

func (*Metric) AddUpdateCount added in v2.8.0

func (m *Metric) AddUpdateCount(count int64)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL