Documentation ¶
Index ¶
- type ApplicationInfo
- type DeleteReportBulkRequest
- type DetailsCreated
- type ExportAPI
- type ExportDatabase
- type HistogramAPI
- type HistogramDatabase
- type InfoAPI
- type InfoResponse
- type IngestAPI
- type IngestDatabase
- type IngestRequest
- type IngestResponse
- type JSONExportRespose
- type MemoryInfo
- type OptionsAPI
- type OptionsDatabase
- type ProjectAPI
- func (api *ProjectAPI) CreateProject(ctx echo.Context) error
- func (api *ProjectAPI) DeleteProject(ctx echo.Context) error
- func (api *ProjectAPI) GetProject(ctx echo.Context) error
- func (api *ProjectAPI) ListProjects(ctx echo.Context) error
- func (api *ProjectAPI) UpdateProject(ctx echo.Context) error
- type ProjectDatabase
- type ProjectList
- type ReportAPI
- func (api *ReportAPI) DeleteReport(ctx echo.Context) error
- func (api *ReportAPI) DeleteReportBulk(ctx echo.Context) error
- func (api *ReportAPI) GetPreviousReport(ctx echo.Context) error
- func (api *ReportAPI) GetReport(ctx echo.Context) error
- func (api *ReportAPI) ListReportsAll(ctx echo.Context) error
- func (api *ReportAPI) ListReportsForProject(ctx echo.Context) error
- type ReportDatabase
- type ReportList
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApplicationInfo ¶
type ApplicationInfo struct { Version string GOVersion string BuildDate string StartTime time.Time }
ApplicationInfo contains info about the app
type DeleteReportBulkRequest ¶
type DeleteReportBulkRequest struct {
IDs []uint `json:"ids"`
}
DeleteReportBulkRequest is the request to delete bulk reports
type DetailsCreated ¶
type DetailsCreated struct { // Number of successfully created detail objects Success uint `json:"success"` // Number of failed detail objects Fail uint `json:"fail"` }
DetailsCreated summary of how many details got created and how many failed
type ExportDatabase ¶
type ExportDatabase interface { FindReportByID(uint) (*model.Report, error) GetHistogramForReport(uint) (*model.Histogram, error) GetOptionsForReport(uint) (*model.Options, error) ListAllDetailsForReport(uint) ([]*model.Detail, error) }
ExportDatabase interface for encapsulating database access.
type HistogramAPI ¶
type HistogramAPI struct {
DB HistogramDatabase
}
The HistogramAPI provides handlers.
func (*HistogramAPI) GetHistogram ¶
func (api *HistogramAPI) GetHistogram(ctx echo.Context) error
GetHistogram gets a histogram for the report
type HistogramDatabase ¶
HistogramDatabase interface for encapsulating database access.
type InfoAPI ¶
type InfoAPI struct {
Info ApplicationInfo
}
The InfoAPI provides handlers for managing projects.
type InfoResponse ¶
type InfoResponse struct { // Version of the application Version string `json:"version"` // Go runtime version RuntimeVersion string `json:"runtimeVersion"` // The build date of the server application BuildDate string `json:"buildDate"` // Uptime of the server Uptime string `json:"uptime"` // Memory info MemoryInfo *MemoryInfo `json:"memoryInfo,omitempty"` }
InfoResponse is the info response
type IngestAPI ¶
type IngestAPI struct {
DB IngestDatabase
}
The IngestAPI provides handlers for ingesting and processing reports.
type IngestDatabase ¶
type IngestDatabase interface { CreateProject(*model.Project) error CreateReport(*model.Report) error CreateHistogram(*model.Histogram) error CreateOptions(*model.Options) error FindProjectByID(uint) (*model.Project, error) FindLatestReportForProject(uint) (*model.Report, error) CreateDetailsBatch(uint, []*model.Detail) (uint, uint) UpdateProjectStatus(uint, model.Status) error }
IngestDatabase interface for encapsulating database access.
type IngestResponse ¶
type IngestResponse struct { // Created project Project *model.Project `json:"project"` // Created report Report *model.Report `json:"report"` // Created Options Options *model.Options `json:"options"` // Created Histogram Histogram *model.Histogram `json:"histogram"` // The summary of created details Details *DetailsCreated `json:"details"` }
IngestResponse is the response to the ingest endpoint
type JSONExportRespose ¶
type JSONExportRespose struct { model.Report Options *model.OptionsInfo `json:"options,omitempty"` Histogram model.BucketList `json:"histogram"` Details []*runner.ResultDetail `json:"details"` }
JSONExportRespose is the response to JSON export
type MemoryInfo ¶
type MemoryInfo struct { // Bytes of allocated heap objects. Alloc uint64 `json:"allocated"` // Cumulative bytes allocated for heap objects. TotalAlloc uint64 `json:"totalAllocated"` // The total bytes of memory obtained from the OS. System uint64 `json:"system"` // The number of pointer lookups performed by the runtime. Lookups uint64 `json:"lookups"` // The cumulative count of heap objects allocated. // The number of live objects is Mallocs - Frees. Mallocs uint64 `json:"mallocs"` // The cumulative count of heap objects freed. Frees uint64 `json:"frees"` // The number of completed GC cycles. NumGC uint32 `json:"numGC"` }
MemoryInfo some memory stats
type OptionsAPI ¶
type OptionsAPI struct {
DB OptionsDatabase
}
The OptionsAPI provides handlers
func (*OptionsAPI) GetOptions ¶
func (api *OptionsAPI) GetOptions(ctx echo.Context) error
GetOptions gets options for a report
type OptionsDatabase ¶
OptionsDatabase interface for encapsulating database access.
type ProjectAPI ¶
type ProjectAPI struct {
DB ProjectDatabase
}
The ProjectAPI provides handlers for managing projects.
func (*ProjectAPI) CreateProject ¶
func (api *ProjectAPI) CreateProject(ctx echo.Context) error
CreateProject creates a project
func (*ProjectAPI) DeleteProject ¶
func (api *ProjectAPI) DeleteProject(ctx echo.Context) error
DeleteProject deletes a project
func (*ProjectAPI) GetProject ¶
func (api *ProjectAPI) GetProject(ctx echo.Context) error
GetProject gets a project
func (*ProjectAPI) ListProjects ¶
func (api *ProjectAPI) ListProjects(ctx echo.Context) error
ListProjects lists projects
func (*ProjectAPI) UpdateProject ¶
func (api *ProjectAPI) UpdateProject(ctx echo.Context) error
UpdateProject updates a project
type ProjectDatabase ¶
type ProjectDatabase interface { CreateProject(project *model.Project) error FindProjectByID(id uint) (*model.Project, error) UpdateProject(*model.Project) error DeleteProject(*model.Project) error CountProjects() (uint, error) ListProjects(limit, page uint, sortField, order string) ([]*model.Project, error) }
ProjectDatabase interface for encapsulating database access.
type ProjectList ¶
ProjectList response
type ReportAPI ¶
type ReportAPI struct {
DB ReportDatabase
}
The ReportAPI provides handlers for managing reports.
func (*ReportAPI) DeleteReport ¶
DeleteReport deletes a report
func (*ReportAPI) DeleteReportBulk ¶
DeleteReportBulk deletes bulk reports
func (*ReportAPI) GetPreviousReport ¶
GetPreviousReport gets a previous report
func (*ReportAPI) ListReportsAll ¶
ListReportsAll gets a list of all reports
type ReportDatabase ¶
type ReportDatabase interface { CountReports() (uint, error) CountReportsForProject(uint) (uint, error) FindReportByID(uint) (*model.Report, error) FindPreviousReport(uint) (*model.Report, error) DeleteReport(*model.Report) error DeleteReportBulk([]uint) (int, error) ListReports(limit, page uint, sortField, order string) ([]*model.Report, error) ListReportsForProject(pid, limit, page uint, sortField, order string) ([]*model.Report, error) }
ReportDatabase interface for encapsulating database access.
type ReportList ¶
ReportList response