Documentation ¶
Index ¶
- func BrowseHandler(w http.ResponseWriter, r *http.Request)
- func DataList() (dataList []string)
- func Error(w http.ResponseWriter, msg ErrorReply)
- func FormValue(r *http.Request, json map[string]interface{}, key string) string
- func GetConfigAtPath(path string, data []byte) (map[string]interface{}, error)
- func Handler(w http.ResponseWriter, r *http.Request)
- func LogAndAddCacheControl(h http.Handler) http.Handler
- func LogAndFilterDataRequest(h http.Handler) http.Handler
- func RESTRunHandler(w http.ResponseWriter, r *http.Request)
- func RESTStatusHandler(w http.ResponseWriter, r *http.Request)
- func RESTStopHandler(w http.ResponseWriter, r *http.Request)
- func Report(baseurl, port, datadir string) bool
- func ResultToJsData(w io.Writer, json []byte)
- func Run(w http.ResponseWriter, r *http.Request, jd map[string]interface{}, ...)
- func SaveJSON(name string, json []byte) string
- func Serve(baseurl, port, debugpath, uipath, datadir string, percentileList []float64) bool
- func StopByRunID(runid int64) int
- func Sync(out io.Writer, u string, datadir string) bool
- func SyncHandler(w http.ResponseWriter, r *http.Request)
- type ChartOptions
- type ErrorReply
- type ListBucketResult
- type SelectableValue
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 DataList ¶ added in v0.6.0
func DataList() (dataList []string)
DataList returns the .json files/entries in data dir.
func Error ¶ added in v1.18.0
func Error(w http.ResponseWriter, msg ErrorReply)
Error writes serialized ErrorReply to the writer.
func FormValue ¶ added in v1.18.0
FormValue gets the value from the query arguments/url parameter or from the provided map (json data).
func GetConfigAtPath ¶ added in v1.18.0
GetConfigAtPath deserializes the bytes as JSON and extracts the map at the given path (only supports simple expression: . is all the json .foo.bar.blah will extract that part of the tree.
func Handler ¶
func Handler(w http.ResponseWriter, r *http.Request)
Handler is the main UI handler creating the web forms and processing them. nolint: funlen, gocognit, gocyclo, nestif, maintidx // should be refactored indeed (TODO)
func LogAndAddCacheControl ¶ added in v0.4.2
LogAndAddCacheControl logs the request and wrapps an HTTP handler to add a Cache-Control header for static files.
func LogAndFilterDataRequest ¶ added in v0.6.0
LogAndFilterDataRequest logs the data request.
func RESTRunHandler ¶ added in v1.18.0
func RESTRunHandler(w http.ResponseWriter, r *http.Request)
RESTRunHandler is api version of UI submit handler.
func RESTStatusHandler ¶ added in v1.18.0
func RESTStatusHandler(w http.ResponseWriter, r *http.Request)
RESTStatusHandler will print the state of the runs.
func RESTStopHandler ¶ added in v1.18.0
func RESTStopHandler(w http.ResponseWriter, r *http.Request)
RESTStopHandler is the api to stop a given run by runid or all the runs if unspecified/0.
func Report ¶ added in v0.5.1
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
ResultToJsData converts a result object to chart data arrays and title and creates a chart from the result object.
func Run ¶ added in v1.18.0
func Run(w http.ResponseWriter, r *http.Request, jd map[string]interface{}, runner, url string, ro periodic.RunnerOptions, httpopts *fhttp.HTTPOptions, )
Run executes the run (can be called async or not, writer is nil for async mode).
func SaveJSON ¶ added in v0.4.2
SaveJSON save Json bytes to give file name (.json) in data-path dir.
func Serve ¶
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). Returns true if server is started successfully.
func StopByRunID ¶ added in v1.18.0
StopByRunID stops all the runs if passed 0 or the runid provided.
func SyncHandler ¶ added in v0.6.4
func SyncHandler(w http.ResponseWriter, r *http.Request)
SyncHandler handles syncing/downloading from tsv url.
Types ¶
type ChartOptions ¶ added in v0.10.0
type ChartOptions struct { XMin string XMax string YMin string YMax string XIsLog bool YIsLog bool }
ChartOptions describes the user-configurable options for a chart.
type ErrorReply ¶ added in v1.18.0
ErrorReply is returned on errors.
type ListBucketResult ¶ added in v0.6.5
type ListBucketResult struct { NextMarker string `xml:"NextMarker"` Names []string `xml:"Contents>Key"` }
ListBucketResult is the minimum we need out of s3 xml results. https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGET.html e.g. https://storage.googleapis.com/fortio-data?max-keys=2&prefix=fortio.istio.io/
type SelectableValue ¶ added in v0.10.0
SelectableValue represets an entry in the <select> of results.
func SelectValues ¶ added in v0.10.0
func SelectValues(values []string, selectedValues []string) (selectableValues []SelectableValue, numSelected int)
SelectValues maps the list of values (from DataList) to a list of SelectableValues. Each returned SelectableValue is selected if its value is contained in selectedValues. It is assumed that values does not contain duplicates.