Documentation ¶
Index ¶
- func AddExecution(execution *models.Execution) (int64, error)
- func AddRegistry(registry *models.Registry) (int64, error)
- func AddRepPolicy(policy *models.RepPolicy) (int64, error)
- func AddTask(task *models.Task) (int64, error)
- func DeleteAllExecutions(policyID int64) error
- func DeleteAllTasks(executionID int64) error
- func DeleteExecution(id int64) error
- func DeleteRegistry(id int64) error
- func DeleteRepPolicy(id int64) error
- func DeleteTask(id int64) error
- func GetExecution(id int64) (*models.Execution, error)
- func GetExecutions(query ...*models.ExecutionQuery) ([]*models.Execution, error)
- func GetPolicies(queries ...*model.PolicyQuery) (int64, []*models.RepPolicy, error)
- func GetRegistry(id int64) (*models.Registry, error)
- func GetRegistryByName(name string) (*models.Registry, error)
- func GetRegistryByURL(url string) (*models.Registry, error)
- func GetRepPolicy(id int64) (policy *models.RepPolicy, err error)
- func GetRepPolicyByName(name string) (policy *models.RepPolicy, err error)
- func GetTask(id int64) (*models.Task, error)
- func GetTasks(query ...*models.TaskQuery) ([]*models.Task, error)
- func GetTotalOfExecutions(query ...*models.ExecutionQuery) (int64, error)
- func GetTotalOfTasks(query ...*models.TaskQuery) (int64, error)
- func ListRegistries(query ...*ListRegistryQuery) (int64, []*models.Registry, error)
- func UpdateExecution(execution *models.Execution, props ...string) (int64, error)
- func UpdateRegistry(registry *models.Registry, props ...string) error
- func UpdateRepPolicy(policy *models.RepPolicy, props ...string) (err error)
- func UpdateTask(task *models.Task, props ...string) (int64, error)
- func UpdateTaskStatus(id int64, status string, statusCondition ...string) (int64, error)
- type ListRegistryQuery
- type ScheduleJobDAO
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddRegistry ¶
AddRegistry add a new registry
func AddRepPolicy ¶
AddRepPolicy insert new policy to DB.
func DeleteRepPolicy ¶
DeleteRepPolicy will hard delete database item
func GetExecutions ¶
func GetExecutions(query ...*models.ExecutionQuery) ([]*models.Execution, error)
GetExecutions ...
func GetPolicies ¶
GetPolicies list polices with given query parameters.
func GetRegistry ¶
GetRegistry gets one registry from database by id.
func GetRegistryByName ¶
GetRegistryByName gets one registry from database by its name.
func GetRegistryByURL ¶
GetRegistryByURL gets one registry from database by its URL.
func GetRepPolicy ¶
GetRepPolicy return special policy by id.
func GetRepPolicyByName ¶
GetRepPolicyByName return special policy by name.
func GetTotalOfExecutions ¶
func GetTotalOfExecutions(query ...*models.ExecutionQuery) (int64, error)
GetTotalOfExecutions returns the total count of replication execution
func GetTotalOfTasks ¶
GetTotalOfTasks ...
func ListRegistries ¶
func ListRegistries(query ...*ListRegistryQuery) (int64, []*models.Registry, error)
ListRegistries lists registries. Registries returned are sorted by creation time. - query: query to the registry name, name query and pagination are defined.
func UpdateExecution ¶
UpdateExecution ...
func UpdateRegistry ¶
UpdateRegistry updates one registry
func UpdateRepPolicy ¶
UpdateRepPolicy update fields by props
func UpdateTaskStatus ¶
UpdateTaskStatus updates the status of task. The implementation uses raw sql rather than QuerySetter.Filter... as QuerySetter will generate sql like:
`UPDATE "replication_task" SET "end_time" = $1, "status" = $2 WHERE "id" IN ( SELECT T0."id" FROM "replication_task" T0 WHERE T0."id" = $3 AND T0."status" IN ($4, $5, $6))]`
which is not a "single" sql statement, this will cause issues when running in concurrency
Types ¶
type ListRegistryQuery ¶
type ListRegistryQuery struct { // Query is name query Query string // Offset specifies the offset in the registry list to return Offset int64 // Limit specifies the maximum registries to return Limit int64 }
ListRegistryQuery defines the query conditions to list registry.
type ScheduleJobDAO ¶
type ScheduleJobDAO interface { Add(*models.ScheduleJob) (int64, error) Get(int64) (*models.ScheduleJob, error) Update(*models.ScheduleJob, ...string) error Delete(int64) error List(...*models.ScheduleJobQuery) ([]*models.ScheduleJob, error) }
ScheduleJobDAO ...
var ScheduleJob ScheduleJobDAO = &scheduleJobDAO{}
ScheduleJob is the DAO for schedule job