rest

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CweMitreOrgDefinitionsUrl = "http://cwe.mitre.org/data/definitions"
)

Variables

View Source
var (
	ReportStatusAll            = []string{"新增", "已分类", "已忽略", "已修复", "显式忽略"}
	ReportStatusFixedOrIgnored = []string{"已忽略", "已修复", "显式忽略"}
	ReportStatusToFixed        = []string{"新增", "已分类"}
)

Functions

This section is empty.

Types

type Column

type Column struct {
	Name  string `json:"name"`
	Label string `json:"label"`
}

type DefectDetails

type DefectDetails struct {
	CweCategory      int    `json:"cweCategory"`
	MergedDefectCID  int    `json:"mergedDefectCID"`
	ShortDescription string `json:"shortDescription"`
	LocalEffect      string `json:"localEffect"`
	LongDescription  string `json:"longDescription"`
	FunctionName     string `json:"functionName"`
}

type HttpService

type HttpService struct {
	Url      string
	User     string
	Password string
}

func (*HttpService) DoAuthRequest

func (svc *HttpService) DoAuthRequest(method, endPoint string, headers, params map[string]string, body interface{}, v interface{}) error

func (*HttpService) DoAuthRequestReturnSession

func (svc *HttpService) DoAuthRequestReturnSession(method, endPoint string, headers, params map[string]string, body interface{}, v interface{}) (*http.Cookie, error)

func (*HttpService) DoCookieRequest

func (svc *HttpService) DoCookieRequest(method, endPoint string, cookie *http.Cookie, headers, params map[string]string, body interface{}, v interface{}) error

type NextPagePost

type NextPagePost struct {
	ProjectId int `json:"projectId"`
	ViewId    int `json:"viewId"`
	PageNum   int `json:"pageNum"`
}

type Project

type Project struct {
	Id    string `json:"id"`
	Type  string `json:"type"`
	Label string `json:"label"`
}

type ProjectSearchResult

type ProjectSearchResult struct {
	Result []Project `json:"Result"`
}

type ProjectSearchResultSet

type ProjectSearchResultSet struct {
	ResultSet ProjectSearchResult `json:"ResultSet"`
}

type ProjectService

type ProjectService struct {
	HttpSvc *HttpService
}

func (*ProjectService) GetProjectByName

func (svc *ProjectService) GetProjectByName(name string) (*Project, error)

"https://coverity.d.xiaomi.net/projectsandhierarchies/autocomplete.json?text=xtrace-dlt_test-v9.git.n.xiaomi.com" 只能模糊匹配搜索不能精确搜索,比如搜索xxx,会出来 xxx, xxx-a, xxx-b等 SOAP协议的configuration的GetProjects接口也是返回[]Project数组

type ReportResult

type ReportResult struct {
	Action                   string `json:"action"`
	Checker                  string `json:"checker"`
	Cid                      int    `json:"cid"`
	Classification           string `json:"classification"`
	Comment                  string `json:"comment"`
	Committed                bool   `json:"committed"`
	Cwe                      int    `json:"cwe"`
	DisplayCategory          string `json:"displayCategory"`
	DisplayComparison        string `json:"displayComparison"`
	DisplayComponent         string `json:"displayComponent"`
	DisplayFile              string `json:"displayFile"`
	DisplayFirstDetectedBy   string `json:"displayFirstDetectedBy"`
	DisplayFunction          string `json:"displayFunction"`
	DisplayImpact            string `json:"displayImpact"`
	DisplayIssueKind         string `json:"displayIssueKind"`
	DisplayType              string `json:"displayType"`
	Domain                   string `json:"domain"`
	ExternalReference        string `json:"externalReference"`
	FileInstanceId           int    `json:"fileInstanceId"`
	FileLanguage             string `json:"fileLanguage"`
	FirstDetected            string `json:"firstDetected"`
	FirstSnapshotDate        string `json:"firstSnapshotDate"`
	FirstSnapshotDescription string `json:"firstSnapshotDescription"`
	FirstSnapshotId          int    `json:"firstSnapshotId"`
	FirstSnapshotStream      string `json:"firstSnapshotStream"`
	FirstSnapshotTarget      string `json:"firstSnapshotTarget"`
	FirstSnapshotVersion     string `json:"firstSnapshotVersion"`
	FixTarget                string `json:"fixTarget"`
	FunctionMergeName        string `json:"functionMergeName"`
	Id                       int    `json:"id"`
	LastDefectInstanceId     int    `json:"lastDefectInstanceId"`
	LastDetected             string `json:"lastDetected"`
	LastDetectedDescription  string `json:"lastDetectedDescription"`
	LastDetectedId           int    `json:"lastDetectedId"`
	LastDetectedStream       string `json:"lastDetectedStream"`
	LastDetectedTarget       string `json:"lastDetectedTarget"`
	LastDetectedVersion      string `json:"lastDetectedVersion"`
	LastFixed                string `json:"lastFixed"`
	LastTriaged              string `json:"lastTriaged"`
	Legacy                   string `json:"legacy"`
	MergeExtra               string `json:"mergeExtra"`
	MergeKey                 string `json:"mergeKey"`
	OccurrenceCount          int    `json:"occurrenceCount"`
	Owner                    string `json:"owner"`
	OwnerFullName            string `json:"ownerFullName"`
	OwnerId                  int    `json:"ownerId"`
	PivotKey                 string `json:"pivotKey"`
	ProjectId                int    `json:"projectId"`
	RuleStrength             string `json:"ruleStrength"`
	Severity                 string `json:"severity"`
	Status                   string `json:"status"`
	Subcategory              string `json:"subcategory"`
}

type ReportResultSet

type ReportResultSet struct {
	Limit      int            `json:"limit"`
	PageNum    int            `json:"pageNum"`
	TotalCount int            `json:"totalCount"`
	Results    []ReportResult `json:"results"`
}

type ReportService

type ReportService struct {
	HttpSvc *HttpService
}

func (*ReportService) GetProjectReports

func (svc *ReportService) GetProjectReports(projectId int, viewId int, statusRange []string) ([]*ReportResult, error)

"https://coverity.d.xiaomi.net/reports/table.json?projectId=10336&viewId=10025"

type ReportsResponse

type ReportsResponse struct {
	ActiveViewKey ViewKey         `json:"activeViewKey"`
	ResultSet     ReportResultSet `json:"resultSet"`
}

type SourceBrowserService

type SourceBrowserService struct {
	HttpSvc *HttpService
}

func (*SourceBrowserService) GenerateCweUrl

func (svc *SourceBrowserService) GenerateCweUrl(cweCategory int) string

http://cwe.mitre.org/data/definitions/321.html

func (*SourceBrowserService) GetSourceEvents

func (svc *SourceBrowserService) GetSourceEvents(projectId, fileInstanceId, defectInstanceId, mergedDefectId int) ([]*SourceEvent, error)

"https://coverity.d.xiaomi.net/sourcebrowser/source.json?projectId=10163&fileInstanceId=96464328&defectInstanceId=22035059&mergedDefectId=150394"

type SourceEvent

type SourceEvent struct {
	Description string `json:"description"`
	Id          string `json:"id"`
	LineNumber  int    `json:"lineNumber"`
	OrderLabel  string `json:"orderLabel"`
	Ordered     bool   `json:"ordered"`
	Polarity    string `json:"polarity"`
	Tag         string `json:"tag"`
}

type SourceEventsResponse

type SourceEventsResponse struct {
	Events []SourceEvent `json:"events"`
}

type View

type View struct {
	Id      int      `json:"id"`
	Type    string   `json:"type"`
	Name    string   `json:"name"`
	GroupBy bool     `json:"groupBy"`
	Columns []Column `json:"columns"`
}

type ViewKey

type ViewKey struct {
	GroupBy   bool `json:"groupBy"`
	ProjectId int  `json:"projectId"`
	ViewId    int  `json:"viewId"`
}

type ViewService

type ViewService struct {
	HttpSvc *HttpService
}

func (*ViewService) GetDefectsView

func (svc *ViewService) GetDefectsView(opt *View) (*View, error)

type ViewsResponse

type ViewsResponse struct {
	Views []View `json:"views"`
}

Jump to

Keyboard shortcuts

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