Documentation
¶
Overview ¶
Copyright (C) 2020 Synopsys, Inc.
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (C) 2020 Synopsys, Inc.
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (C) 2020 Synopsys, Inc.
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (C) 2020 Synopsys, Inc.
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (C) 2020 Synopsys, Inc.
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (C) 2020 Synopsys, Inc.
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (C) 2020 Synopsys, Inc.
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (C) 2020 Synopsys, Inc.
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- func RunMetricsTests()
- type Client
- func (client *Client) Authenticate() error
- func (client *Client) CreateRoleAssignment(userId string, roleId string, projectId string, orgId string) (string, error)
- func (client *Client) CreateServiceAccount(email string, name string, orgId string, password string) (*CreateUserResponse, error)
- func (client *Client) CreateUser(email string, name string, orgId string) (*CreateUserResponse, error)
- func (client *Client) DownloadCli(dir string, osType OSType) (string, error)
- func (client *Client) GetAccessToken(tokenName string) (*CreateAccessTokenResponse, error)
- func (client *Client) GetEntitlementsForOrganization(orgId string) (*GetEntitlementsForOrganizationResponse, error)
- func (client *Client) GetEntitlementsForProject(projectID string) (*GetEntitlementsForProjectResponse, error)
- func (client *Client) GetGroups() (*GetGroupsResponse, error)
- func (client *Client) GetJobs(limit int) (*GetJobsResponse, error)
- func (client *Client) GetJson(params map[string]interface{}, result interface{}, pathTemplate string, ...) (string, error)
- func (client *Client) GetOrganizations() (*GetOrganizationsResponse, error)
- func (client *Client) GetProjects(limit int) (*GetProjectsResponse, error)
- func (client *Client) GetRawJson(params map[string]interface{}, result interface{}, pathTemplate string, ...) (string, error)
- func (client *Client) GetRoleAssignments(offset int, limit int) (*GetRoleAssignmentsResponse, error)
- func (client *Client) GetRoleAssignmentsForProject(projectId string) (*GetRoleAssignmentsResponse, error)
- func (client *Client) GetRoleAssignmentsForUser(email string, offset int, limit int, isServiceAccount bool) (*GetRoleAssignmentsResponse, error)
- func (client *Client) GetRoles() (*GetRolesResponse, error)
- func (client *Client) GetTaxonomies(tenantId *string, pageLimit int) (*GetTaxonomiesResponse, error)
- func (client *Client) GetTaxonomyCount() (*GetTaxonomiesResponse, error)
- func (client *Client) GetTools(limit int) (*GetToolsResponse, error)
- func (client *Client) GetUserByEmail(email string) (*GetUsersResponse, error)
- func (client *Client) GetUsers(offset int, limit int) (*GetUsersResponse, error)
- func (client *Client) GetV0Branch(branchId string) (*GetV0BranchResponse, error)
- func (client *Client) GetV0Revisions(limit int) (*GetV0RevisionsResponse, error)
- func (client *Client) GetV0RevisionsByBranch(branchId string, limit int) (*GetV0RevisionsResponse, error)
- func (client *Client) GetV0RollUpCounts(projectId string, branchId string, limit int) (*GetV0RollUpCountsResponse, error)
- func (client *Client) GetV1Issue(projectId string, branchId string, issueId string) (*GetV1IssueResponse, error)
- func (client *Client) GetV1Issues(projectId string, branchId string, runId string, offset int, limit int) (*GetV1IssuesResponse, error)
- func (client *Client) GetVinylV0Projects(offset int, limit int) (*GetVinylV0ProjectsResponse, error)
- func (client *Client) GetVinylV0ProjectsRelatedRuns(projectId string) (*GetVinylV0ProjectsRelatedRunsResponse, error)
- func (client *Client) GetVinylV0ProjectsRelationshipsRuns(projectId string) (*GetVinylV0ProjectsRelationshipsRunsResponse, error)
- func (client *Client) PostJson(bodyParams map[string]interface{}, result interface{}, pathTemplate string, ...) (string, error)
- func (client *Client) PostTools() (string, error)
- func (client *Client) QueryV0DiscoveryFilterKeysIssuetoolidValues() (string, error)
- type CreateAccessTokenResponse
- type CreateUserResponse
- type Data
- type GetEntitlementsForOrganizationResponse
- type GetEntitlementsForProjectResponse
- type GetGroupsResponse
- type GetJobsResponse
- type GetOrganizationsResponse
- type GetProjectsResponse
- type GetRoleAssignmentsResponse
- type GetRolesResponse
- type GetTaxonomiesResponse
- type GetToolsResponse
- type GetUsersResponse
- type GetV0BranchResponse
- type GetV0RevisionsResponse
- type GetV0RollUpCountsResponse
- type GetV1IssueResponse
- type GetV1IssuesResponse
- type GetVinylV0ProjectsRelatedRunsResponse
- type GetVinylV0ProjectsRelationshipsRunsResponse
- type GetVinylV0ProjectsResponse
- type IdAndType
- type OSType
- type ProjectRelationshipsData
- type ProjectRelationshipsJustLinks
- type ProjectRelationshipsLinks
- type ProjectRelationshipsLinksAndData
- type V1IssueIncluded
- type V1IssueResponse
- type VinylV0Project
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunMetricsTests ¶
func RunMetricsTests()
Types ¶
type Client ¶
type Client struct {
URL string
Email string
Password string
AuthToken string
RestyClient *resty.Client
// contains filtered or unexported fields
}
func (*Client) Authenticate ¶
func (*Client) CreateRoleAssignment ¶
func (*Client) CreateServiceAccount ¶
func (*Client) CreateUser ¶
func (*Client) DownloadCli ¶
func (*Client) GetAccessToken ¶
func (client *Client) GetAccessToken(tokenName string) (*CreateAccessTokenResponse, error)
func (*Client) GetEntitlementsForOrganization ¶
func (client *Client) GetEntitlementsForOrganization(orgId string) (*GetEntitlementsForOrganizationResponse, error)
func (*Client) GetEntitlementsForProject ¶
func (client *Client) GetEntitlementsForProject(projectID string) (*GetEntitlementsForProjectResponse, error)
func (*Client) GetGroups ¶
func (client *Client) GetGroups() (*GetGroupsResponse, error)
func (*Client) GetOrganizations ¶
func (client *Client) GetOrganizations() (*GetOrganizationsResponse, error)
func (*Client) GetProjects ¶
func (client *Client) GetProjects(limit int) (*GetProjectsResponse, error)
func (*Client) GetRawJson ¶
func (*Client) GetRoleAssignments ¶
func (client *Client) GetRoleAssignments(offset int, limit int) (*GetRoleAssignmentsResponse, error)
func (*Client) GetRoleAssignmentsForProject ¶
func (client *Client) GetRoleAssignmentsForProject(projectId string) (*GetRoleAssignmentsResponse, error)
func (*Client) GetRoleAssignmentsForUser ¶
func (*Client) GetRoles ¶
func (client *Client) GetRoles() (*GetRolesResponse, error)
func (*Client) GetTaxonomies ¶
func (client *Client) GetTaxonomies(tenantId *string, pageLimit int) (*GetTaxonomiesResponse, error)
func (*Client) GetTaxonomyCount ¶
func (client *Client) GetTaxonomyCount() (*GetTaxonomiesResponse, error)
func (*Client) GetUserByEmail ¶
func (client *Client) GetUserByEmail(email string) (*GetUsersResponse, error)
func (*Client) GetUsers ¶
func (client *Client) GetUsers(offset int, limit int) (*GetUsersResponse, error)
func (*Client) GetV0Branch ¶
func (client *Client) GetV0Branch(branchId string) (*GetV0BranchResponse, error)
func (*Client) GetV0Revisions ¶
func (client *Client) GetV0Revisions(limit int) (*GetV0RevisionsResponse, error)
func (*Client) GetV0RevisionsByBranch ¶
func (client *Client) GetV0RevisionsByBranch(branchId string, limit int) (*GetV0RevisionsResponse, error)
func (*Client) GetV0RollUpCounts ¶
func (*Client) GetV1Issue ¶
func (*Client) GetV1Issues ¶
func (*Client) GetVinylV0Projects ¶
func (client *Client) GetVinylV0Projects(offset int, limit int) (*GetVinylV0ProjectsResponse, error)
func (*Client) GetVinylV0ProjectsRelatedRuns ¶
func (client *Client) GetVinylV0ProjectsRelatedRuns(projectId string) (*GetVinylV0ProjectsRelatedRunsResponse, error)
func (*Client) GetVinylV0ProjectsRelationshipsRuns ¶
func (client *Client) GetVinylV0ProjectsRelationshipsRuns(projectId string) (*GetVinylV0ProjectsRelationshipsRunsResponse, error)
func (*Client) PostTools ¶
PostTools handles
https://sig-gitlab.internal.synopsys.com/clops/polaris-local/-/blob/master/README.md#temporary-workaround-if-needed-1
func (*Client) QueryV0DiscoveryFilterKeysIssuetoolidValues ¶
type CreateAccessTokenResponse ¶
type CreateAccessTokenResponse struct {
Data struct {
Attributes struct {
AccessToken string `json:"access-token"`
} `json:"attributes"`
} `json:"data"`
}
type CreateUserResponse ¶
type GetGroupsResponse ¶
type GetJobsResponse ¶
type GetProjectsResponse ¶
type GetProjectsResponse struct {
Data []struct {
Type string
Id string
Attributes struct {
// TODO properties
Name string
}
Relationships struct {
Branches *ProjectRelationshipsJustLinks
Runs *ProjectRelationshipsJustLinks
ProjectPreference *ProjectRelationshipsLinksAndData `json:"project-preference"`
UserDefaultBranch *ProjectRelationshipsLinksAndData `json:"user-default-branch"`
}
Links *struct {
Self *struct {
HRef string
Meta *struct {
Durable string
}
}
}
Meta struct {
Etag string
OrganizationId string `json:"organization-id"`
InTrash bool `json:"in-trash"`
}
}
// TODO included, links
Meta struct {
// Offset int
Limit int
Total int
}
}
type GetRoleAssignmentsResponse ¶
type GetRoleAssignmentsResponse struct {
Data []struct {
Type string
Id string
Attributes struct {
ExpiresBy string `json:"expires-by"`
Object string
}
Relationships map[string]struct {
Links struct {
Self string
Related string
}
Data struct {
Type string
Id string
}
}
}
Meta struct {
Limit int
Offset int
Total int
}
}
type GetRolesResponse ¶
type GetTaxonomiesResponse ¶
type GetTaxonomiesResponse struct {
Data []struct {
TaxonomyType string `json:"taxonomy-type"`
Id string
OptimisticLock string `json:"optimistic-lock"`
Taxonomy struct {
Taxa []struct {
Id string
Name struct {
En string
}
}
Name struct {
En string
}
Description struct {
En string
}
Abbreviation struct {
En string
}
// TODO extra
// TODO depends-on
RootTaxa []string `json:"root-taxa"`
}
}
Meta struct {
Total int
Offset int
Limit int
}
}
type GetToolsResponse ¶
type GetUsersResponse ¶
type GetV0BranchResponse ¶
type GetV0RevisionsResponse ¶
type GetV0RollUpCountsResponse ¶
type GetV0RollUpCountsResponse struct {
Data []struct {
Id string
Type string
Relationships map[string]struct {
Data *struct {
Id string
Type string
}
}
Attributes struct {
Value int
}
}
Included []struct {
Id string
Type string
Attributes map[string]interface{} // TODO type?
}
Meta struct {
Offset int
Limit int
Total int
Complete bool
GroupBy string `json:"group-by"`
RunCount int `json:"run-count"`
}
}
type GetV1IssueResponse ¶
type GetV1IssueResponse struct {
Data V1IssueResponse
Included []V1IssueIncluded
}
type GetV1IssuesResponse ¶
type GetV1IssuesResponse struct {
Data []V1IssueResponse
Included []V1IssueIncluded
Meta struct {
Total int
Offset int
Limit int
Complete bool
RunCount int `json:"run-count"`
}
}
type GetVinylV0ProjectsRelatedRunsResponse ¶
type GetVinylV0ProjectsRelatedRunsResponse struct {
Data []struct {
Type string
Id string
Attributes struct {
CompletedDate string `json:"completed-date"`
Segment bool
Status string
UploadId string `json:"upload-id"`
RunType string `json:"run-type"`
CreationDate string `json:"creation-date"`
Fingerprints []interface{}
}
}
}
type GetVinylV0ProjectsResponse ¶
type GetVinylV0ProjectsResponse struct {
Data []*VinylV0Project
Included []struct {
// TODO Type="branch" has different stuff than Type="entitlements"
Type string
Id string
Attributes map[string]interface{}
Relationships map[string]interface{}
Links struct {
Self struct {
HRef string
}
}
Meta *struct {
ETag string
InTrash bool `json:"in-trash"`
}
}
Meta struct {
Offset int
Limit int
Total int
}
}
type OSType ¶
type OSType string
...
func MustParseOSType ¶
func ParseOSType ¶
func (OSType) PlatformType ¶
func (OSType) PolarisCLIUrl ¶
func (*OSType) UnmarshalJSON ¶
func (*OSType) UnmarshalText ¶
type ProjectRelationshipsJustLinks ¶
type ProjectRelationshipsJustLinks struct {
Links ProjectRelationshipsLinks
}
type ProjectRelationshipsLinksAndData ¶
type ProjectRelationshipsLinksAndData struct {
Links ProjectRelationshipsLinks
Data *ProjectRelationshipsData
}
type V1IssueIncluded ¶
type V1IssueResponse ¶
type V1IssueResponse struct {
Attributes struct {
FindingKey string `json:"finding-key"`
IssueKey string `json:"issue-key"`
SubTool string `json:"sub-tool"`
}
Id string
Type string
Relationships struct {
Path Data
ToolDomainService Data `json:"tool-domain-service-data"`
IssueType Data `json:"issue-type"`
Tool Data
LatestObservedOnRun Data `json:"latest-observed-on-run"`
Transitions struct {
Data []IdAndType
}
RelatedTaxa struct {
Data []interface{} // TODO type ?
} `json:"related-taxa"`
RelatedIndicators struct {
Data []interface{} // TODO type ?
} `json:"related-indicators"`
IssueKind interface{} `json:"issue-kind"` // TODO type?
Severity interface{} // TODO type?
}
Links struct {
Self struct {
HRef string
}
}
}