Documentation ¶
Index ¶
- Constants
- func AuthenticateUploader(aeAPI shared.AppEngineAPI, r *http.Request) string
- func HandleResultsCreate(a API, s checks.API, w http.ResponseWriter, r *http.Request)
- func HandleResultsUpload(a API, w http.ResponseWriter, r *http.Request)
- func HandleUpdatePendingTestRun(a API, w http.ResponseWriter, r *http.Request)
- func RegisterRoutes()
- type API
Constants ¶
const BufferBucket = "wptd-results-buffer"
BufferBucket is the GCS bucket to temporarily store results until they are proccessed.
const InternalUsername = "_processor"
InternalUsername is a special uploader whose password is kept secret and can only be accessed by services in this AppEngine project via Datastore.
const ResultsQueue = "results-arrival"
ResultsQueue is the name of the results processing TaskQueue.
const ResultsTarget = "/api/results/process"
ResultsTarget is the target URL for results processing tasks.
Variables ¶
This section is empty.
Functions ¶
func AuthenticateUploader ¶
func AuthenticateUploader(aeAPI shared.AppEngineAPI, r *http.Request) string
AuthenticateUploader checks the HTTP basic auth against SecretManager, and returns the username if it's valid or "" otherwise.
This function is not defined on API interface for easier reuse in other packages.
func HandleResultsCreate ¶
HandleResultsCreate handles the POST requests for creating test runs.
func HandleResultsUpload ¶
func HandleResultsUpload(a API, w http.ResponseWriter, r *http.Request)
HandleResultsUpload handles the POST requests for uploading results.
func HandleUpdatePendingTestRun ¶
func HandleUpdatePendingTestRun(a API, w http.ResponseWriter, r *http.Request)
HandleUpdatePendingTestRun handles the PATCH request for updating pending test runs.
func RegisterRoutes ¶
func RegisterRoutes()
RegisterRoutes adds all the result receiver route handlers.
Types ¶
type API ¶
type API interface { shared.AppEngineAPI AddTestRun(testRun *shared.TestRun) (shared.Key, error) IsAdmin(*http.Request) bool ScheduleResultsTask(uploader string, results, screenshots []string, extraParams map[string]string) (string, error) UpdatePendingTestRun(pendingRun shared.PendingTestRun) error UploadToGCS(gcsPath string, f io.Reader, gzipped bool) error }
API abstracts all AppEngine/GCP APIs used by the results receiver.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package client is a package for simplifying the upload request made by a client to the results receiver upload endpoint (/api/results/upload).
|
Package client is a package for simplifying the upload request made by a client to the results receiver upload endpoint (/api/results/upload). |
Package mock_receiver is a generated GoMock package.
|
Package mock_receiver is a generated GoMock package. |