Documentation ¶
Index ¶
- Constants
- Variables
- func GetPolymorphicValue(taskType dvmodel.TaskType) string
- type ConcreteTask
- type DeployTaskService
- func (s *DeployTaskService) Create(tx *gorm.DB, data map[string]any) (int64, error)
- func (s *DeployTaskService) Delete(tx *gorm.DB, t *dvmodel.Task) error
- func (s *DeployTaskService) FindOneById(id int64) (*dvmodel.DeployTask, error)
- func (s *DeployTaskService) Run(ctx context.Context, t *dvmodel.Task) error
- func (s *DeployTaskService) Start(ctx context.Context, t *dvmodel.Task) error
- func (s *DeployTaskService) Stop(ctx context.Context, t *dvmodel.Task) error
- func (s *DeployTaskService) Update(tx *gorm.DB, data map[string]any, id int64) error
- type LogService
- func (s *LogService) IsLogEnd(line string) bool
- func (s *LogService) OpenHostLogFile(taskId int64, host string, hostLogName string) (*os.File, error)
- func (s *LogService) OpenLatestManifestLogFile(taskId int64) (*os.File, error)
- func (s *LogService) ParseManifestEntry(entryLine string) (*ManifestEntry, error)
- type ManifestEntry
- type TaskService
- func (s *TaskService) CreateTask(info *req.TaskUpsertReq) error
- func (s *TaskService) DeleteTask(id int64) error
- func (s *TaskService) FindOneById(id int64) (*dvmodel.Task, error)
- func (s *TaskService) PageList(keyword string, page, pageSize int) (*res.PageableData[*dvRes.TaskRes], error)
- func (s *TaskService) StartTask(uId, id int64) error
- func (s *TaskService) StopTask(id int64) error
- func (s *TaskService) UpdateTask(id int64, info *req.TaskUpsertReq) error
Constants ¶
View Source
const LogEndFlag = "-[EOF]-"
Variables ¶
View Source
var ErrReachedLogEnd = errors.New("reached log end")
Functions ¶
func GetPolymorphicValue ¶
Types ¶
type ConcreteTask ¶
type ConcreteTask interface { FindOneById(id int64) (*dvmodel.DeployTask, error) Create(tx *gorm.DB, data map[string]any) (id int64, err error) Update(tx *gorm.DB, data map[string]any, id int64) error Delete(tx *gorm.DB, t *dvmodel.Task) error Start(ctx context.Context, t *dvmodel.Task) error Run(ctx context.Context, t *dvmodel.Task) error Stop(ctx context.Context, t *dvmodel.Task) error }
func Select ¶
func Select(taskType dvmodel.TaskType) ConcreteTask
type DeployTaskService ¶
type DeployTaskService struct {
// contains filtered or unexported fields
}
func (*DeployTaskService) FindOneById ¶
func (s *DeployTaskService) FindOneById(id int64) (*dvmodel.DeployTask, error)
type LogService ¶
type LogService struct { }
func GetTaskLogService ¶
func GetTaskLogService() *LogService
func (*LogService) IsLogEnd ¶
func (s *LogService) IsLogEnd(line string) bool
func (*LogService) OpenHostLogFile ¶
func (*LogService) OpenLatestManifestLogFile ¶
func (s *LogService) OpenLatestManifestLogFile(taskId int64) (*os.File, error)
func (*LogService) ParseManifestEntry ¶
func (s *LogService) ParseManifestEntry(entryLine string) (*ManifestEntry, error)
type ManifestEntry ¶
type TaskService ¶
type TaskService struct { }
func GetTaskService ¶
func GetTaskService() *TaskService
func (*TaskService) CreateTask ¶
func (s *TaskService) CreateTask(info *req.TaskUpsertReq) error
func (*TaskService) DeleteTask ¶
func (s *TaskService) DeleteTask(id int64) error
func (*TaskService) FindOneById ¶
func (s *TaskService) FindOneById(id int64) (*dvmodel.Task, error)
func (*TaskService) PageList ¶
func (s *TaskService) PageList(keyword string, page, pageSize int) (*res.PageableData[*dvRes.TaskRes], error)
func (*TaskService) StartTask ¶
func (s *TaskService) StartTask(uId, id int64) error
func (*TaskService) StopTask ¶
func (s *TaskService) StopTask(id int64) error
func (*TaskService) UpdateTask ¶
func (s *TaskService) UpdateTask(id int64, info *req.TaskUpsertReq) error
Click to show internal directories.
Click to hide internal directories.