loader

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2021 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(key string, cfg *commonconfig.DownloaderConfig,
	factory CreateFunc, release ReleaseFunc,
	createParams, releaseParams interface{}) bool

Register 注册任务

Types

type CreateFunc

type CreateFunc func(dataPath string, params interface{}) ITable

type ITable

type ITable interface{}

func GetTable

func GetTable(key string) ITable

type Job

type Job struct {
	Key            string
	Finder         finder.IFinder
	Interval       int
	IterCount      int64
	DownloadConfig *commonconfig.DownloaderConfig
}

type Manager

type Manager struct {
	Locker   *sync.RWMutex
	TableMap map[string]ITable
	JobMap   map[string]*Job
}
var ManagerImp *Manager

type ReleaseFunc added in v0.0.7

type ReleaseFunc func(ITable, interface{})

type Status

type Status int
const (
	DownloadOK Status = iota + 1
	RemoteFileError
	LocalFileIsNewest
	DownloadFileError
	WriteLocalETagError
)

Jump to

Keyboard shortcuts

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