Documentation
¶
Overview ¶
Package pagekit holds the shared design of the standalone pages that Giant Swarm services serve outside a product UI: sign-in results, device-code entry, consent and error pages.
The design sources (page layout, stylesheet, logos and wording) live in this repository next to this package, so the package can embed them and consumers ship the pages inside their own binaries, with nothing loaded at runtime. Consumers that are not Go programs, such as Dex, are meant to take the same sources as files.
Render writes a result page, such as the page a browser shows after a sign-in:
pagekit.Render(w, http.StatusOK, pagekit.Page{
Title: "Signed in to GitHub",
Heading: "Signed in",
Summary: "GitHub is now connected",
Message: "You can close this tab and return to Cursor.",
})
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Page ¶
type Page struct {
// Title is the browser tab title, such as "Signed in to GitHub". It
// defaults to Heading.
Title string
// Heading is the outcome in a few words, such as "Signed in". It
// defaults to "Done", or "Something went wrong" for an error status.
Heading string
// Summary says what the outcome applies to, such as "GitHub is now
// connected".
Summary string
// Message says what to do next, such as "You can close this tab and
// return to Cursor."
Message string
// Detail is a technical hint for support, such as an error code. It is
// shown in monospace.
Detail string
// Reference is a code the person can pass on to support, such as a
// request ID that also appears in the logs.
Reference string
}
Page is the content of a result page. All text is escaped, and every field is optional.