Documentation ¶
Overview ¶
Package asyncdownload NOTES
Package asyncdownload NOTES ¶
Package asyncdownload NOTES
Index ¶
- Constants
- Variables
- func InitMetric() *metric
- type CacheCleaner
- type Scheduler
- type Service
- func (ad *Service) CreateAsyncDownloadTask(kt *kit.Kit, bizID, appID uint32, ...) (string, error)
- func (ad *Service) GetAsyncDownloadTask(kt *kit.Kit, bizID uint32, taskID string) (*types.AsyncDownloadTask, error)
- func (ad *Service) GetAsyncDownloadTaskStatus(kt *kit.Kit, bizID uint32, taskID string) (string, error)
Constants ¶
View Source
const GB = 1024 * 1024 * 1024
GB is the size of 1GB in bytes
Variables ¶
View Source
var (
// JobTimeoutSeconds is the timeout seconds for async download job
JobTimeoutSeconds = 10 * 60
)
Functions ¶
func InitMetric ¶
func InitMetric() *metric
InitMetric init the async doenload related prometheus metrics
Types ¶
type CacheCleaner ¶
type CacheCleaner struct {
// contains filtered or unexported fields
}
CacheCleaner scheduled task to clean source file cache dir
func NewCacheCleaner ¶
func NewCacheCleaner(cacaheSizeGB int, cacheRetentionRate float64, mc *metric) *CacheCleaner
NewCacheCleaner create a CacheCleaner
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
Scheduler scheduled task to process download jobs
func NewScheduler ¶
NewScheduler create a async download scheduler
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service defines async download related operations.
func NewService ¶
NewService initialize the async download service instance.
func (*Service) CreateAsyncDownloadTask ¶
func (ad *Service) CreateAsyncDownloadTask(kt *kit.Kit, bizID, appID uint32, filePath, fileName, targetAgentID, targetContainerID, targetUser, targetDir, signature string) (string, error)
CreateAsyncDownloadTask creates a new async download task.
func (*Service) GetAsyncDownloadTask ¶
func (ad *Service) GetAsyncDownloadTask(kt *kit.Kit, bizID uint32, taskID string) ( *types.AsyncDownloadTask, error)
GetAsyncDownloadTask get async download task record.
Click to show internal directories.
Click to hide internal directories.