Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateTask ¶ added in v1.17.4
CreateTask creates a task on database
func FinishMigrateTask ¶ added in v1.17.4
FinishMigrateTask updates database when migrate task finished
func HasFinishedMigratingTask ¶ added in v1.17.4
HasFinishedMigratingTask returns if a finished migration task exists for the repo.
func IsErrTaskDoesNotExist ¶ added in v1.17.4
IsErrTaskDoesNotExist checks if an error is a ErrTaskDoesNotExist.
Types ¶
type ErrTaskDoesNotExist ¶ added in v1.17.4
ErrTaskDoesNotExist represents a "TaskDoesNotExist" kind of error.
func (ErrTaskDoesNotExist) Error ¶ added in v1.17.4
func (err ErrTaskDoesNotExist) Error() string
func (ErrTaskDoesNotExist) Unwrap ¶ added in v1.17.4
func (err ErrTaskDoesNotExist) Unwrap() error
type FindTaskOptions ¶ added in v1.17.4
type FindTaskOptions struct {
Status int
}
FindTaskOptions find all tasks
func (FindTaskOptions) ToConds ¶ added in v1.17.4
func (opts FindTaskOptions) ToConds() builder.Cond
ToConds generates conditions for database operation.
type Task ¶ added in v1.17.4
type Task struct { ID int64 DoerID int64 `xorm:"index"` // operator Doer *user_model.User `xorm:"-"` OwnerID int64 `xorm:"index"` // repo owner id, when creating, the repoID maybe zero Owner *user_model.User `xorm:"-"` RepoID int64 `xorm:"index"` Repo *repo_model.Repository `xorm:"-"` Type structs.TaskType Status structs.TaskStatus `xorm:"index"` StartTime timeutil.TimeStamp EndTime timeutil.TimeStamp PayloadContent string `xorm:"TEXT"` Message string `xorm:"TEXT"` // if task failed, saved the error reason Created timeutil.TimeStamp `xorm:"created"` }
Task represents a task
func FindTasks ¶ added in v1.17.4
func FindTasks(opts FindTaskOptions) ([]*Task, error)
FindTasks find all tasks
func GetMigratingTask ¶ added in v1.17.4
GetMigratingTask returns the migrating task by repo's id
func GetMigratingTaskByID ¶ added in v1.17.4
func GetMigratingTaskByID(id, doerID int64) (*Task, *migration.MigrateOptions, error)
GetMigratingTaskByID returns the migrating task by repo's id
func (*Task) MigrateConfig ¶ added in v1.17.4
func (task *Task) MigrateConfig() (*migration.MigrateOptions, error)
MigrateConfig returns task config when migrate repository
func (*Task) UpdateCols ¶ added in v1.17.4
UpdateCols updates some columns
type TranslatableMessage ¶ added in v1.17.4
type TranslatableMessage struct { Format string Args []interface{} `json:"omitempty"` }
TranslatableMessage represents JSON struct that can be translated with a Locale