mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-23 17:31:11 +01:00
- Introduced a new POST endpoint '/:id/run' in the router to trigger the execution of a schedule. - Implemented the PostScheduleRun function to handle the execution logic, including validation of input parameters and scheduling tasks. - Refactored the PostSpiderRun function to streamline the scheduling process by directly calling the admin service. - Updated the FsFileInfo struct to clarify the children field description. - Modified the Task model to make NodeIds field optional in JSON serialization.
61 lines
1.5 KiB
Go
61 lines
1.5 KiB
Go
package entity
|
|
|
|
import (
|
|
"github.com/crawlab-team/crawlab/core/interfaces"
|
|
"os"
|
|
"time"
|
|
)
|
|
|
|
type FsFileInfo struct {
|
|
Name string `json:"name"` // file name
|
|
Path string `json:"path"` // file path
|
|
FullPath string `json:"full_path"` // file full path
|
|
Extension string `json:"extension"` // file extension
|
|
IsDir bool `json:"is_dir"` // whether it is directory
|
|
FileSize int64 `json:"file_size"` // file size (bytes)
|
|
Children []interfaces.FsFileInfo `json:"children"` // children for subdirectory
|
|
ModTime time.Time `json:"mod_time"` // modification time
|
|
Mode os.FileMode `json:"mode"` // file mode
|
|
Hash string `json:"hash"` // file hash
|
|
}
|
|
|
|
func (f *FsFileInfo) GetName() string {
|
|
return f.Name
|
|
}
|
|
|
|
func (f *FsFileInfo) GetPath() string {
|
|
return f.Path
|
|
}
|
|
|
|
func (f *FsFileInfo) GetFullPath() string {
|
|
return f.FullPath
|
|
}
|
|
|
|
func (f *FsFileInfo) GetExtension() string {
|
|
return f.Extension
|
|
}
|
|
|
|
func (f *FsFileInfo) GetIsDir() bool {
|
|
return f.IsDir
|
|
}
|
|
|
|
func (f *FsFileInfo) GetFileSize() int64 {
|
|
return f.FileSize
|
|
}
|
|
|
|
func (f *FsFileInfo) GetModTime() time.Time {
|
|
return f.ModTime
|
|
}
|
|
|
|
func (f *FsFileInfo) GetMode() os.FileMode {
|
|
return f.Mode
|
|
}
|
|
|
|
func (f *FsFileInfo) GetHash() string {
|
|
return f.Hash
|
|
}
|
|
|
|
func (f *FsFileInfo) GetChildren() []interfaces.FsFileInfo {
|
|
return f.Children
|
|
}
|