Documentation ¶
Index ¶
- func AddHandlers(externalRouter chi.Router)
- func DecodeTask(taskJson io.Reader) (task_common.Task, error)
- func EncodeTask(taskJson io.Writer, oldestTask task_common.Task) error
- func GetGCEPendingTaskCount(ctx context.Context) (int, error)
- func GetOldestPendingTask(ctx context.Context) (task_common.Task, error)
- func GetPendingTaskCount(ctx context.Context) (int64, error)
- func ReloadTemplates(resourcesDir string)
- type CompletedTask
- type CompletedTaskResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddHandlers ¶
func AddHandlers(externalRouter chi.Router)
func DecodeTask ¶
func DecodeTask(taskJson io.Reader) (task_common.Task, error)
Reads JSON response from ctfeutil.GET_OLDEST_PENDING_TASK_URI and returns either the Task decoded from the response or nil if there are no pending tasks. Returns an error if there is a problem decoding the JSON. Does not close taskJson.
func EncodeTask ¶
func EncodeTask(taskJson io.Writer, oldestTask task_common.Task) error
Writes JSON representation of oldestTask to taskJson. Returns an error if oldestTask's type is unknown, if there was an error encoding to JSON, or there is an error writing to taskJson. Does not close taskJson.
func GetGCEPendingTaskCount ¶
GetGCEPendingTaskCount returns count of pending GCE CT tasks from all task types.
func GetOldestPendingTask ¶
func GetOldestPendingTask(ctx context.Context) (task_common.Task, error)
GetOldestPendingTask returns the oldest pending task of any type.
func GetPendingTaskCount ¶
GetPendingTaskCount returns the total number of pending tasks of all types. On error, the first return value will be -1 and the second return value will be non-nil.
func ReloadTemplates ¶
func ReloadTemplates(resourcesDir string)
Types ¶
type CompletedTask ¶
type CompletedTaskResponse ¶
type CompletedTaskResponse struct { UniqueUsers int `json:"unique_users"` CompletedTasks []CompletedTask `json:"completed_tasks"` }