frontend

package
v0.0.0-...-ef45db5 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 66 Imported by: 2

Documentation

Overview

Package frontend contains all the milo frontend code, including static HTML generation, HTTP routing, etc.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConsoleHandler

func ConsoleHandler(c *router.Context) error

ConsoleHandler renders the console page.

func ErrorHandler

func ErrorHandler(c *router.Context, err error)

ErrorHandler renders an error page for the user.

func GetBuildPage

func GetBuildPage(ctx *router.Context, br *buildbucketpb.GetBuildRequest, blamelistOpt buildbucket.BlamelistOption) (*ui.BuildPage, error)

GetBuildPage fetches the full set of information for a Milo build page from Buildbucket. Including the blamelist and other auxiliary information.

func GetLimit

func GetLimit(r *http.Request, def int) int

GetLimit extracts the "limit", "numbuilds", or "num_builds" http param from the request, or returns def implying no limit was specified.

func GetReload

func GetReload(r *http.Request, def int) int

GetReload extracts the "reload" http param from the request, or returns def implying no limit was specified.

func ProjectLinks(c context.Context, project, group string) []ui.LinkGroup

ProjectLinks returns the navigation list surrounding a project and optionally group.

func Run

func Run(srv *server.Server, templatePath string)

Run sets up all the routes and runs the server.

Types

type HTTPService

type HTTPService struct {
	Server *server.Server

	// GetSettings returns the current setting for milo.
	GetSettings func(c context.Context) (*configpb.Settings, error)

	// GetResultDBClient returns a ResultDB client for the given context.
	GetResultDBClient func(c context.Context, host string, as auth.RPCAuthorityKind) (rdbpb.ResultDBClient, error)
}

HTTPService is the Milo frontend service that serves multiple HTTP endpoints. TODO(weiweilin): move other HTTP endpoints to HTTPService.

func (*HTTPService) RegisterRoutes

func (s *HTTPService) RegisterRoutes()

RegisterRoutes registers routes explicitly handled by the handler.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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