scan

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: 6 Imported by: 16

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

func (p *Scan) GetAllSessions() []*Session

get all session from this session and all children recursively

func (*Scan) GetSession

func (p *Scan) GetSession(id bson.ObjectId) *Session

func (*Scan) String

func (p *Scan) String() string

type ScanConf

type ScanConf struct {
	Target string                 `json:"target"`
	Params map[string]interface{} `json:"params"`
}

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

func (p *Session) GetAllChildren() []*Session

get all children from this session and all children recursively

func (*Session) GetChild

func (p *Session) GetChild(id bson.ObjectId) *Session

func (*Session) HasParent

func (p *Session) HasParent() bool

Jump to

Keyboard shortcuts

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