analyzer

package
v0.0.0-...-d2356ba Latest Latest
Warning

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

Go to latest
Published: May 19, 2017 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Overview

Package analyzer analyzes the uploaded bugreport and displays the results to the user.

Index

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

type UploadedFile struct {
	FileType string
	FileName string
	Contents []byte
}

UploadedFile is a user uploaded bugreport or its associated file to be analyzed.

Jump to

Keyboard shortcuts

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