Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BrowseHandler

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

BrowseHandler handles listing and rendering the JSON results.

func DataList

func DataList() (dataList []string)

DataList returns the .json files/entries in data dir.

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 // should be refactored indeed (TODO)

func LogAndAddCacheControl

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 LogAndFilterDataRequest

func LogAndFilterDataRequest(h http.Handler) http.Handler

LogAndFilterDataRequest logs the data request.

func Report

func Report(baseurl, port, staticRsrcDir string, datadir string) bool

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

func ResultToJsData

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

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

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

func Serve

func Serve(baseurl, port, debugpath, uipath, staticRsrcDir string, datadir string, percentileList []float64) bool

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 Sync

func Sync(out io.Writer, u string, datadir string) bool

Sync is the non http equivalent of fortio/sync?url=u.

func SyncHandler

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

SyncHandler handles syncing/downloading from tsv url.

Types

type ChartOptions

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 ListBucketResult

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

type SelectableValue struct {
	Value    string
	Selected bool
}

SelectableValue represets an entry in the <select> of results.

func SelectValues

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.

Source Files