Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dates ¶
type Dates struct {
Created *time.Time `json:"created,omitempty"`
Updated *time.Time `json:"updated,omitempty"`
Queued *time.Time `json:"queued,omitempty"`
Started *time.Time `json:"started,omitempty"`
Finished *time.Time `json:"finished,omitempty"`
}
useful time points
type Scan ¶
type Scan struct {
Id bson.ObjectId `json:"id,omitempty" bson:"_id"`
Status ScanStatus `json:"status,omitempty" description:"one of [created|queued|working|pause|finished|failed]"`
Conf ScanConf `json:"conf,omitempty"`
// Report *report.Report `json:"report,omitempty" form:"-"`
Sessions []*Session `json:"sessions,omitempty"`
Plan bson.ObjectId `json:"plan"`
Owner bson.ObjectId `json:"owner,omitempty"`
Target bson.ObjectId `json:"target"`
Project bson.ObjectId `json:"project"`
// dates
Dates `json:",inline"`
}
func (*Scan) GetAllSessions ¶
get all session from this session and all children recursively
type ScanList ¶
type ScanList struct {
pagination.Meta `json:",inline"`
Results []*Scan `json:"results"`
}
type ScanStatus ¶
type ScanStatus string
const ( StatusCreated ScanStatus = "created" StatusQueued ScanStatus = "queued" // put scan to queue StatusWorking ScanStatus = "working" // scan was taken by agent StatusPaused ScanStatus = "paused" StatusFinished ScanStatus = "finished" StatusFailed ScanStatus = "failed" )
func (ScanStatus) Convert ¶
func (t ScanStatus) Convert(text string) (interface{}, error)
func (ScanStatus) Enum ¶
func (t ScanStatus) Enum() []interface{}
func (ScanStatus) MarshalJSON ¶
func (t ScanStatus) MarshalJSON() ([]byte, error)
It's a hack to show custom type as string in swagger
type Session ¶
type Session struct {
Id bson.ObjectId `json:"id,omitempty"`
Status ScanStatus `json:"status" description:"one of [created|queued|working|paused|finished|failed]"`
Step *plan.WorkflowStep `json:"step"`
Plugin bson.ObjectId `json:"plugin,omitempty" description:"plugin id"`
Scan bson.ObjectId `json:"scan" description:"scan id"`
// dates
Dates `json:",inline"`
// Children can be created by plugins
Children []*Session `json:"children,omitempty" description:"children can be created by scripts" bson:"children,omitempty"`
Parent bson.ObjectId `json:"parent,omitempty" description:"parent session for this one" bson:"parent,omitempty"`
}
func (*Session) GetAllChildren ¶
get all children from this session and all children recursively
Click to show internal directories.
Click to hide internal directories.