Documentation ¶
Index ¶
- Constants
- func AddHandlers(externalRouter, internalRouter *mux.Router)
- func AddTask(ctx context.Context, task AddTaskVars) (int64, error)
- func AddTaskHandler(w http.ResponseWriter, r *http.Request, task AddTaskVars)
- func DatastoreTaskQuery(ctx context.Context, prototype Task, params QueryParams) *datastore.Iterator
- func DeleteTaskHandler(prototype Task, w http.ResponseWriter, r *http.Request)
- func GetNextId(ctx context.Context, kind ds.Kind, task Task) (int64, error)
- func GetTasksHandler(prototype Task, w http.ResponseWriter, r *http.Request)
- func HasPageSetsColumn(prototype Task) bool
- func RedoTaskHandler(prototype Task, w http.ResponseWriter, r *http.Request)
- func UpdateTask(ctx context.Context, vars UpdateTaskVars, task Task) error
- func UpdateTaskHandler(vars UpdateTaskVars, prototype Task, w http.ResponseWriter, r *http.Request)
- type AddTaskCommonVars
- type AddTaskVars
- type ByPageSetDesc
- type ClusterTelemetryIDs
- type CommonCols
- type PageSet
- type QueryParams
- type Task
- type UpdateTaskCommonVars
- type UpdateTaskVars
Constants ¶
View Source
const ( // Default page size used for pagination. DEFAULT_PAGE_SIZE = 10 // Maximum page size used for pagination. MAX_PAGE_SIZE = 100 )
Variables ¶
This section is empty.
Functions ¶
func AddHandlers ¶
func AddTask ¶
func AddTask(ctx context.Context, task AddTaskVars) (int64, error)
Returns the ID of the inserted task if the operation was successful.
func AddTaskHandler ¶
func AddTaskHandler(w http.ResponseWriter, r *http.Request, task AddTaskVars)
func DatastoreTaskQuery ¶
func DeleteTaskHandler ¶
func DeleteTaskHandler(prototype Task, w http.ResponseWriter, r *http.Request)
func GetTasksHandler ¶
func GetTasksHandler(prototype Task, w http.ResponseWriter, r *http.Request)
func HasPageSetsColumn ¶
func RedoTaskHandler ¶
func RedoTaskHandler(prototype Task, w http.ResponseWriter, r *http.Request)
func UpdateTask ¶
func UpdateTask(ctx context.Context, vars UpdateTaskVars, task Task) error
func UpdateTaskHandler ¶
func UpdateTaskHandler(vars UpdateTaskVars, prototype Task, w http.ResponseWriter, r *http.Request)
Types ¶
type AddTaskCommonVars ¶
type AddTaskCommonVars struct { Username string TsAdded string RepeatAfterDays string `json:"repeat_after_days"` }
Data included in all tasks; set by AddTaskHandler.
func (*AddTaskCommonVars) GetAddTaskCommonVars ¶
func (vars *AddTaskCommonVars) GetAddTaskCommonVars() *AddTaskCommonVars
func (*AddTaskCommonVars) IsAdminTask ¶
func (vars *AddTaskCommonVars) IsAdminTask() bool
type AddTaskVars ¶
type ByPageSetDesc ¶
type ByPageSetDesc []PageSet
ByPageSetDesc implements sort.Interface to order PageSets by their descriptions.
func (ByPageSetDesc) Len ¶
func (p ByPageSetDesc) Len() int
func (ByPageSetDesc) Less ¶
func (p ByPageSetDesc) Less(i, j int) bool
func (ByPageSetDesc) Swap ¶
func (p ByPageSetDesc) Swap(i, j int)
type ClusterTelemetryIDs ¶
type ClusterTelemetryIDs struct {
HighestID int64
}
type CommonCols ¶
type CommonCols struct { DatastoreKey *datastore.Key `datastore:"__key__"` TsAdded int64 TsStarted int64 TsCompleted int64 Username string Failure bool RepeatAfterDays int64 SwarmingLogs string TaskDone bool }
func (*CommonCols) GetCommonCols ¶
func (dbrow *CommonCols) GetCommonCols() *CommonCols
type QueryParams ¶
type QueryParams struct { // If non-empty, limits to only tasks with the given username. Username string // Include only tasks that have completed successfully. SuccessfulOnly bool // Include only tasks that are not yet completed. PendingOnly bool // Include only completed tasks that are scheduled to repeat. FutureRunsOnly bool // Exclude tasks where page_sets is PAGESET_TYPE_DUMMY_1k. ExcludeDummyPageSets bool // If true, SELECT COUNT(*). If false, SELECT * and include ORDER BY and LIMIT clauses. CountQuery bool // First term of LIMIT clause; ignored if countQuery is true. Offset int // Second term of LIMIT clause; ignored if countQuery is true. Size int }
type Task ¶
type Task interface { GetCommonCols() *CommonCols GetTaskName() string GetDatastoreKind() ds.Kind // Returns a slice of the struct type. Query(it *datastore.Iterator) (interface{}, error) // Returns the struct type. Get(c context.Context, key *datastore.Key) (Task, error) // Returns the corresponding UpdateTaskVars instance of this Task. The // returned instance is not populated. GetUpdateTaskVars() UpdateTaskVars // Returns the corresponding AddTaskVars instance of this Task. The returned // instance is populated. GetPopulatedAddTaskVars() (AddTaskVars, error) // Returns the results link for this task if it completed successfully and if // the task supports results links. GetResultsLink() string }
func AsTaskSlice ¶
func AsTaskSlice(selectResult interface{}) []Task
Takes the result of Task.Query and returns a slice of Tasks containing the same objects.
type UpdateTaskCommonVars ¶
type UpdateTaskCommonVars struct { Id int64 TsStarted string TsCompleted string Failure bool TaskDone bool RepeatAfterDays int64 ClearRepeatAfterDays bool SwarmingLogs string }
Data included in all update requests.
func (*UpdateTaskCommonVars) GetUpdateTaskCommonVars ¶
func (vars *UpdateTaskCommonVars) GetUpdateTaskCommonVars() *UpdateTaskCommonVars
func (*UpdateTaskCommonVars) SetCompleted ¶
func (vars *UpdateTaskCommonVars) SetCompleted(success bool)
func (*UpdateTaskCommonVars) SetStarted ¶
func (vars *UpdateTaskCommonVars) SetStarted(runID string)
type UpdateTaskVars ¶
type UpdateTaskVars interface { GetUpdateTaskCommonVars() *UpdateTaskCommonVars UriPath() string // Adds CT task specific updates for fields not in UpdateTaskCommonVars. UpdateExtraFields(Task) error }
Click to show internal directories.
Click to hide internal directories.