pkg: Index | Files

package fw

import ""


Package Files

context.go utils.go

func RenderError Uses

func RenderError(w http.ResponseWriter, statusCode int, err error)

RenderError outputs an error message

func RenderHTML Uses

func RenderHTML(w http.ResponseWriter, t *template.Template, data interface{})

RenderHTML executes the given template, sending the output to the supplied response writer

func RenderJSON Uses

func RenderJSON(w http.ResponseWriter, statusCode int, data interface{})

RenderJSON outputs the given data as JSON

type Topic Uses

type Topic interface {

    // Title returns the title for the area, which will be used in the sidenav and window title.
    Title() string

    // Prefix is the name used to reference this functionality in URLs.
    Prefix() string

    // Activate triggers a topic to register itself to receive traffic.

Topic is used to describe a single major ControlZ functional area.

type TopicContext Uses

type TopicContext interface {
    // HTMLRouter is used to control HTML traffic delivered to this topic.
    HTMLRouter() *mux.Router

    // JSONRouter is used to control HTML traffic delivered to this topic.
    JSONRouter() *mux.Router

    // Layout is the template used as the primary layout for the topic's HTML content.
    Layout() *template.Template

TopicContext provides support objects needed to register a topic.

func NewContext Uses

func NewContext(htmlRouter *mux.Router, jsonRouter *mux.Router, layout *template.Template) TopicContext

NewContext creates a new TopicContext.

Package fw imports 6 packages (graph) and is imported by 6 packages. Updated 2019-05-13. Refresh now. Tools for package owners.