util

package
v0.0.0-...-ec67e64 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 13, 2024 License: BSD-3-Clause Imports: 14 Imported by: 12

Documentation

Overview

Utility that contains methods for dealing with emails.

Index

Constants

View Source
const (
	CHROMIUM_PERF_URI                  = "chromium_perf/"
	CHROMIUM_PERF_RUNS_URI             = "chromium_perf_runs/"
	ADD_CHROMIUM_PERF_TASK_POST_URI    = "_/add_chromium_perf_task"
	GET_CHROMIUM_PERF_TASKS_POST_URI   = "_/get_chromium_perf_tasks"
	DELETE_CHROMIUM_PERF_TASK_POST_URI = "_/delete_chromium_perf_task"
	REDO_CHROMIUM_PERF_TASK_POST_URI   = "_/redo_chromium_perf_task"
	EDIT_CHROMIUM_PERF_TASK_POST_URI   = "_/edit_chromium_perf_task"

	CHROMIUM_ANALYSIS_URI                  = "chromium_analysis/"
	CHROMIUM_ANALYSIS_RUNS_URI             = "chromium_analysis_runs/"
	ADD_CHROMIUM_ANALYSIS_TASK_POST_URI    = "_/add_chromium_analysis_task"
	GET_CHROMIUM_ANALYSIS_TASKS_POST_URI   = "_/get_chromium_analysis_tasks"
	DELETE_CHROMIUM_ANALYSIS_TASK_POST_URI = "_/delete_chromium_analysis_task"
	REDO_CHROMIUM_ANALYSIS_TASK_POST_URI   = "_/redo_chromium_analysis_task"
	EDIT_CHROMIUM_ANALYSIS_TASK_POST_URI   = "_/edit_chromium_analysis_task"

	METRICS_ANALYSIS_URI                  = "metrics_analysis/"
	METRICS_ANALYSIS_RUNS_URI             = "metrics_analysis_runs/"
	ADD_METRICS_ANALYSIS_TASK_POST_URI    = "_/add_metrics_analysis_task"
	GET_METRICS_ANALYSIS_TASKS_POST_URI   = "_/get_metrics_analysis_tasks"
	DELETE_METRICS_ANALYSIS_TASK_POST_URI = "_/delete_metrics_analysis_task"
	REDO_METRICS_ANALYSIS_TASK_POST_URI   = "_/redo_metrics_analysis_task"
	EDIT_METRICS_ANALYSIS_TASK_POST_URI   = "_/edit_metrics_analysis_task"

	ADMIN_TASK_URI = "admin_tasks/"

	RECREATE_PAGE_SETS_RUNS_URI             = "recreate_page_sets_runs/"
	ADD_RECREATE_PAGE_SETS_TASK_POST_URI    = "_/add_recreate_page_sets_task"
	GET_RECREATE_PAGE_SETS_TASKS_POST_URI   = "_/get_recreate_page_sets_tasks"
	DELETE_RECREATE_PAGE_SETS_TASK_POST_URI = "_/delete_recreate_page_sets_task"
	REDO_RECREATE_PAGE_SETS_TASK_POST_URI   = "_/redo_recreate_page_sets_task"

	RECREATE_WEBPAGE_ARCHIVES_RUNS_URI             = "recreate_webpage_archives_runs/"
	ADD_RECREATE_WEBPAGE_ARCHIVES_TASK_POST_URI    = "_/add_recreate_webpage_archives_task"
	GET_RECREATE_WEBPAGE_ARCHIVES_TASKS_POST_URI   = "_/get_recreate_webpage_archives_tasks"
	DELETE_RECREATE_WEBPAGE_ARCHIVES_TASK_POST_URI = "_/delete_recreate_webpage_archives_task"
	REDO_RECREATE_WEBPAGE_ARCHIVES_TASK_POST_URI   = "_/redo_recreate_webpage_archives_task"

	RUNS_HISTORY_URI = "history/"

	PENDING_TASKS_URI = "queue/"

	PAGE_SETS_PARAMETERS_POST_URI = "_/page_sets/"
	CL_DATA_POST_URI              = "_/cl_data"
	BENCHMARKS_PLATFORMS_POST_URI = "_/benchmarks_platforms/"
	TASK_PRIORITIES_GET_URI       = "_/task_priorities/"
	IS_ADMIN_GET_URI              = "_/is_admin/"
	COMPLETED_TASKS_POST_URL      = "_/completed_tasks"

	RESULTS_URI = "/results/"

	OAUTH2_CALLBACK_PATH = "/oauth2callback/"

	MAX_GROUPNAME_LEN = 30
)

URIs for frontend handlers.

Variables

View Source
var PreExecuteTemplateHook = func() {}

Function to run before executing a template.

Functions

func ExecuteSimpleTemplate

func ExecuteSimpleTemplate(template *template.Template, w http.ResponseWriter, r *http.Request)

func GetCTPerfEmailHtml

func GetCTPerfEmailHtml(groupName string) string

func GetFailureEmailHtml

func GetFailureEmailHtml(runID string) string

func GetQualifiedCustomWebpages

func GetQualifiedCustomWebpages(customWebpages, benchmarkArgs string) ([]string, error)
func GetSwarmingLogsLink(runID string) string

GetSwarmingLogsLink returns HTML snippet that contains a href to the swarming logs.

func ParseBoolFormValue

func ParseBoolFormValue(string string) bool

Returns true if the string is non-empty, unless strconv.ParseBool parses the string as false.

func ParseEmails

func ParseEmails(emails string) []string

ParseEmails returns an array containing emails from the provided comma separated emails string.

func SendEmail

func SendEmail(recipients []string, subject, body string) error

SendEmail sends an email with the specified header and body to the recipients.

func SendEmailWithMarkup

func SendEmailWithMarkup(recipients []string, subject, body, markup string) error

SendEmailWithMarkup sends an email with the specified header and body to the recipients. It also includes gmail markups. Documentation about markups supported in gmail are here: https://developers.google.com/gmail/markup/ A go-to action example is here: https://developers.google.com/gmail/markup/reference/go-to-action

func SendTaskStartEmail

func SendTaskStartEmail(taskId int64, recipients []string, taskName, runID, runDescription, additionalDescription string) error

func SendTasksTerminatedEmail

func SendTasksTerminatedEmail(recipients []string) error

SendTasksTerminatedEmail informs the recipients that their CT tasks were terminated and that they should reschedule.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL