Documentation ¶
Overview ¶
Package analyzer analyzes the uploaded bugreport and displays the results to the user.
Index ¶
- func AnalyzeAndResponse(w http.ResponseWriter, r *http.Request, files map[string]UploadedFile)
- func HTTPAnalyzeHandler(w http.ResponseWriter, r *http.Request)
- func InitTemplates(dir string)
- func SetIsOptimized(optimized bool)
- func SetResVersion(v int)
- func SetScriptsDir(dir string)
- func UploadHandler(w http.ResponseWriter, r *http.Request)
- type BatteryStatsInfo
- type ParsedData
- type UploadedFile
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AnalyzeAndResponse ¶
func AnalyzeAndResponse(w http.ResponseWriter, r *http.Request, files map[string]UploadedFile)
AnalyzeAndResponse analyzes the uploaded files and sends the HTTP response in JSON.
func HTTPAnalyzeHandler ¶
func HTTPAnalyzeHandler(w http.ResponseWriter, r *http.Request)
HTTPAnalyzeHandler processes the bugreport package uploaded via an http request's multipart body.
func InitTemplates ¶
func InitTemplates(dir string)
InitTemplates initializes the HTML templates after google.Init() is called. google.Init() must be called before resources can be accessed.
func SetIsOptimized ¶
func SetIsOptimized(optimized bool)
SetIsOptimized sets whether the JS will be optimized.
func SetResVersion ¶
func SetResVersion(v int)
SetResVersion sets the current version to force reloading of JS and CSS files.
func SetScriptsDir ¶
func SetScriptsDir(dir string)
SetScriptsDir sets the directory of the Historian and kernel trace Python scripts.
func UploadHandler ¶
func UploadHandler(w http.ResponseWriter, r *http.Request)
UploadHandler serves the upload html page.
Types ¶
type BatteryStatsInfo ¶
type BatteryStatsInfo struct { Filename string Stats *bspb.BatteryStats Meta *bugreportutils.MetaInfo }
BatteryStatsInfo holds the extracted batterystats details for a bugreport.
type ParsedData ¶
type ParsedData struct {
// contains filtered or unexported fields
}
ParsedData holds the extracted details from the parsing of each file.
func (*ParsedData) AnalyzeFiles ¶
func (pd *ParsedData) AnalyzeFiles(files map[string]UploadedFile) error
AnalyzeFiles processes and analyzes the list of uploaded files.
func (*ParsedData) Cleanup ¶
func (pd *ParsedData) Cleanup()
Cleanup removes all temporary files written by the ParsedData analyzer. Should be called after ParsedData is no longer needed.
func (*ParsedData) Data ¶
func (pd *ParsedData) Data() []presenter.HTMLData
Data returns the data field from ParsedData
func (*ParsedData) SendAsJSON ¶
func (pd *ParsedData) SendAsJSON(w http.ResponseWriter, r *http.Request)
SendAsJSON creates and sends the HTML output and json response from the ParsedData.
type UploadedFile ¶
UploadedFile is a user uploaded bugreport or its associated file to be analyzed.