handler

package
v0.0.0-...-9994f1b Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2025 License: BSD-3-Clause Imports: 45 Imported by: 0

Documentation

Overview

Package handler implements HTTP server that handles requests to default module.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUnrecognizedTree indicates that a request specified an unrecognized tree.
	ErrUnrecognizedTree = fmt.Errorf("unrecognized tree name")
)

Functions

func FlushOldAlertsHandler

func FlushOldAlertsHandler(ctx context.Context) error

FlushOldAlertsHandler deletes old resolved alerts from datastore.

func FlushOldAnnotationsHandler

func FlushOldAnnotationsHandler(ctx context.Context) error

FlushOldAnnotationsHandler culls obsolete annotations from the datastore. TODO (crbug.com/1079068): Perhaps we want to revisit flush annotation logic.

func GetAlerts

func GetAlerts(ctx context.Context, tree string, unresolved, resolved bool) (*messages.AlertsSummary, error)

GetAlerts reads the alerts from datastore.

func GetAlertsCommonHandler

func GetAlertsCommonHandler(ctx *router.Context, unresolved bool, resolved bool) *messages.AlertsSummary

GetAlertsCommonHandler handles API requests for alerts.

func GetAlertsHandler

func GetAlertsHandler(ctx *router.Context)

GetAlertsHandler handles API requests for all alerts and revision summaries.

func GetAnalyzeHandler

func GetAnalyzeHandler(ctx *router.Context)

GetAnalyzeHandler enqueues a request to run an analysis on a particular tree. This is usually hit by appengine cron rather than manually.

func GetBQQueryHandler

func GetBQQueryHandler(ctx *router.Context)

GetBQQueryHandler queries BQ sheriffable_failures for a particular project, and caches the result. This is usually hit by appengine cron rather than manually.

func GetLayoutTestsHandler

func GetLayoutTestsHandler(ctx *router.Context)

GetLayoutTestsHandler returns a JSON summary of webkit layout tests and their expected results.

func GetResolvedAlertsHandler

func GetResolvedAlertsHandler(ctx *router.Context)

GetResolvedAlertsHandler handles API requests for resolved alerts.

func GetRevRangeHandler

func GetRevRangeHandler(ctx *router.Context)

GetRevRangeHandler returns a revision range queury for gitiles, given one or two commit positions.

func GetTreeLogoHandler

func GetTreeLogoHandler(ctx *router.Context)

GetTreeLogoHandler returns a signed URL to an image asset hosted on GCS.

func GetTrees

func GetTrees(c context.Context) ([]byte, error)

GetTrees retrieves all trees from the DataStore.

func GetUnresolvedAlertsHandler

func GetUnresolvedAlertsHandler(ctx *router.Context)

GetUnresolvedAlertsHandler handles API requests for unresolved alerts and revision summaries.

func GetUserAutocompleteHandler

func GetUserAutocompleteHandler(ctx *router.Context)

GetUserAutocompleteHandler returns chromium developer email addresses that match the query string.

func PostClientMonHandler

func PostClientMonHandler(ctx *router.Context)

PostClientMonHandler handles uncaught javascript errors reported by the client.

func PostLayoutTestExpectationChangeHandler

func PostLayoutTestExpectationChangeHandler(ctx *router.Context)

PostLayoutTestExpectationChangeHandler enqueues an asynchronous task to create a Gerrit changelist to change test expectations based on the fields POSTed to it.

func WithAnalyzer

func WithAnalyzer(ctx context.Context, a *analyzer.Analyzer) context.Context

WithAnalyzer returns a context with a attached as a context value.

Types

type AnnotationHandler

type AnnotationHandler struct {
}

AnnotationHandler handles annotation-related requests.

func (*AnnotationHandler) GetAnnotationsHandler

func (ah *AnnotationHandler) GetAnnotationsHandler(ctx *router.Context, activeKeys map[string]interface{})

GetAnnotationsHandler retrieves a set of annotations.

func (*AnnotationHandler) PostAnnotationsHandler

func (ah *AnnotationHandler) PostAnnotationsHandler(ctx *router.Context)

PostAnnotationsHandler handles updates to annotations.

type AnnotationResponse

type AnnotationResponse struct {
	model.Annotation
	BugData map[string]MonorailBugData `json:"bug_data"`
}

AnnotationResponse ... The Annotation object extended with cached bug data.

type AnnotationsIssueClient

type AnnotationsIssueClient interface {
	SearchIssues(context.Context, *monorailv3.SearchIssuesRequest, ...grpc.CallOption) (*monorailv3.SearchIssuesResponse, error)
}

AnnotationsIssueClient is for testing purpose

type MonorailBugData

type MonorailBugData struct {
	BugID     string `json:"id,omitempty"`
	ProjectID string `json:"projectId,omitempty"`
	Summary   string `json:"summary,omitempty"`
	Status    string `json:"status,omitempty"`
}

MonorailBugData wrap around monorailv3.Issue to send to frontend.

type SettingsPage

type SettingsPage struct {
	portal.BasePage
}

SettingsPage is the SoM admin settings page.

func (SettingsPage) Fields

func (SettingsPage) Fields(c context.Context) ([]portal.Field, error)

Fields returns a list of settings fields.

func (SettingsPage) ReadSettings

func (SettingsPage) ReadSettings(c context.Context) (map[string]string, error)

ReadSettings converts query parameters and POST body into settings values.

func (SettingsPage) Title

func (SettingsPage) Title(c context.Context) (string, error)

Title returns the settings page title.

func (SettingsPage) WriteSettings

func (SettingsPage) WriteSettings(c context.Context, values map[string]string) error

WriteSettings persists the settings values.

Jump to

Keyboard shortcuts

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