Documentation ¶
Overview ¶
Package frontend contains all the milo frontend code, including static HTML generation, HTTP routing, etc.
Index ¶
- func ConsoleHandler(c *router.Context) error
- func ErrorHandler(c *router.Context, err error)
- func GetBuildPage(ctx *router.Context, br *buildbucketpb.GetBuildRequest, ...) (*ui.BuildPage, error)
- func GetLimit(r *http.Request, def int) int
- func GetReload(r *http.Request, def int) int
- func ProjectLinks(c context.Context, project, group string) []ui.LinkGroup
- func Run(srv *server.Server, templatePath string)
- type HTTPService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConsoleHandler ¶
ConsoleHandler renders the console page.
func ErrorHandler ¶
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 ¶
GetLimit extracts the "limit", "numbuilds", or "num_builds" http param from the request, or returns def implying no limit was specified.
func GetReload ¶
GetReload extracts the "reload" http param from the request, or returns def implying no limit was specified.
func ProjectLinks ¶
ProjectLinks returns the navigation list surrounding a project and optionally group.
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.