report

package
v0.0.0-...-c937b9e Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2015 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeEmpty  = ReportType("empty")
	TypeRaw    = ReportType("raw")
	TypeMulti  = ReportType("multi")
	TypeIssues = ReportType("issues")
	TypeTechs  = ReportType("techs")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Raw

type Raw struct {
	Raw   string       `json:"raw"`
	Files []*file.Meta `json:"files,omitempty" bson:"files,omitempty"`
}

type Report

type Report struct {
	Id          bson.ObjectId `json:"id,omitempty" bson:"_id"`
	Type        ReportType    `json:"type" description:"one of [raw,issues,techs,multi,empty]"`
	Created     time.Time     `json:"created,omitempty" description:"when report is created"`
	Updated     time.Time     `json:"updated,omitempty" description:"when report is updated"`
	Scan        bson.ObjectId `json:"scan,omitempty" description:"scan id"`
	ScanSession bson.ObjectId `json:"scanSession,omitempty" bson:"scanSession" description:"scan session id"`

	Raw `json:",inline,omitempty" bson:"raw,inline"`

	Multi  []*Report      `json:"multi,omitempty" bson:"multi,omitempty"`
	Issues []*issue.Issue `json:"issues,omitempty" bson:"issues,omitempty"`
	Techs  []*tech.Tech   `json:"techs,omitempty"`
}

func (*Report) GetAllIssues

func (r *Report) GetAllIssues() []*issue.Issue

get all issues from the report and underlying multi reports

func (*Report) GetAllTechs

func (r *Report) GetAllTechs() []*tech.Tech

get all techs from the report and underlying multi reports

func (*Report) SetScan

func (r *Report) SetScan(scanId bson.ObjectId)

set scan to report and all underlying multi reports if they are existed

func (*Report) SetScanSession

func (r *Report) SetScanSession(sessionId bson.ObjectId)

type ReportList

type ReportList struct {
	pagination.Meta `json:",inline"`
	Results         []*Report `json:"results"`
}

type ReportType

type ReportType string

func (ReportType) Convert

func (t ReportType) Convert(text string) (interface{}, error)

func (ReportType) Enum

func (t ReportType) Enum() []interface{}

func (ReportType) MarshalJSON

func (t ReportType) MarshalJSON() ([]byte, error)

It's a hack to show custom type as string in swagger

Jump to

Keyboard shortcuts

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