issuesapp: Index | Files | Directories

package issuesapp

import ""

Package issuesapp is a web frontend for an issues service.

Note, the canonical issue tracker for this package is currently hosted at It is implemented using this very package.


Package Files

display.go doc.go main.go mock.go tabs.go


var BaseURIContextKey = &contextKey{"BaseURI"}

BaseURIContextKey is a context key for the request's base URI. That value specifies the base URI prefix to use for all absolute URLs. The associated value will be of type string.

var RepoSpecContextKey = &contextKey{"RepoSpec"}

RepoSpecContextKey is a context key for the request's issues.RepoSpec. That value specifies which repo the issues are to be displayed for. The associated value will be of type issues.RepoSpec.

func New Uses

func New(service issues.Service, usersService users.Service, opt Options) http.Handler

New returns an issues app http.Handler using given services and options. If usersService is nil, then there is no way to have an authenticated user. Emojis image data is expected to be available at /emojis/emojis.png, unless opt.DisableReactions is true.

In order to serve HTTP requests, the returned http.Handler expects each incoming request to have 2 parameters provided to it via RepoSpecContextKey and BaseURIContextKey context keys. For example:

issuesApp := issuesapp.New(...)

http.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) {
	req = req.WithContext(context.WithValue(req.Context(), issuesapp.RepoSpecContextKey, issues.RepoSpec{...}))
	req = req.WithContext(context.WithValue(req.Context(), issuesapp.BaseURIContextKey, string(...)))
	issuesApp.ServeHTTP(w, req)

type Options Uses

type Options struct {
    Notifications    notifications.Service // If not nil, issues containing unread notifications are highlighted.
    DisableReactions bool                  // Disable all support for displaying and toggling reactions.

    HeadPre template.HTML
    BodyPre string // An html/template definition of "body-pre" template.

    // BodyTop provides components to include on top of <body> of page rendered for req. It can be nil.
    BodyTop func(req *http.Request) ([]htmlg.Component, error)


assetsPackage assets contains assets for issuesapp.
commonPackage common contains common code for backend and frontend.

Package issuesapp imports 29 packages (graph) and is imported by 2 packages. Updated 2017-03-24. Refresh now. Tools for package owners.