ui

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2018 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BrowseHandler added in v0.4.2

func BrowseHandler(w http.ResponseWriter, r *http.Request)

BrowseHandler handles listing and rendering the JSON results.

func FetcherHandler

func FetcherHandler(w http.ResponseWriter, r *http.Request)

FetcherHandler is the handler for the fetcher/proxy.

func Handler

func Handler(w http.ResponseWriter, r *http.Request)

Handler is the main UI handler creating the web forms and processing them.

func LogAndAddCacheControl added in v0.4.2

func LogAndAddCacheControl(h http.Handler) http.Handler

LogAndAddCacheControl logs the request and wrapps an HTTP handler to add a Cache-Control header for static files.

func LogDataRequest added in v0.4.2

func LogDataRequest(h http.Handler) http.Handler

LogDataRequest logs the data request.

func LogRequest

func LogRequest(r *http.Request, msg string)

LogRequest logs the incoming request, including headers when loglevel is verbose

func Report added in v0.5.1

func Report(port int, staticRsrcDir string, datadir string)

Report starts the browsing only UI server on the given port. Similar to Serve with only the read only part.

func ResultToJsData added in v0.4.2

func ResultToJsData(w io.Writer, json []byte)

ResultToJsData converts a result object to chart data arrays and title and creates a chart from the result object

func SaveJSON added in v0.4.2

func SaveJSON(name string, json []byte) string

SaveJSON save Json bytes to give file name (.json) in data-path dir.

func Serve

func Serve(port int, debugpath, uipath, staticRsrcDir string, datadir string)

Serve starts the fhttp.Serve() plus the UI server on the given port and paths (empty disables the feature). uiPath should end with / (be a 'directory' path)

Types

type HTMLEscapeWriter added in v0.4.2

type HTMLEscapeWriter struct {
	NextWriter io.Writer
}

HTMLEscapeWriter is an io.Writer escaping the output for safe html inclusion.

func (*HTMLEscapeWriter) Write added in v0.4.2

func (w *HTMLEscapeWriter) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

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