Documentation ¶
Index ¶
- func BuildCloudAPIContext(ctx context.Context, user, password, token string) context.Context
- func BuildServerAPIContext(ctx context.Context, bbURL, user, password, token string) (context.Context, error)
- type APIClient
- type AnnotationsRequest
- type CloudAPIClient
- type CloudAPIHelper
- type ReportAnnotator
- type ReportRequest
- type ServerAPIClient
- type ServerAPIHelper
- type UnexpectedResponseError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildCloudAPIContext ¶ added in v0.13.0
BuildCloudAPIContext builds context.Context used to call Bitbucket Cloud Code Insights API
Types ¶
type APIClient ¶ added in v0.13.0
type APIClient interface { // CreateOrUpdateReport creates or updates specified report CreateOrUpdateReport(ctx context.Context, req *ReportRequest) error // CreateOrUpdateAnnotations creates or updates annotations CreateOrUpdateAnnotations(ctx context.Context, req *AnnotationsRequest) error }
APIClient is client for Bitbucket Code Insights API
func NewCloudAPIClient ¶ added in v0.13.0
NewCloudAPIClient creates client for Bitbucket Cloud Insights API
func NewCloudAPIClientWithConfigurations ¶ added in v0.13.0
func NewCloudAPIClientWithConfigurations(client *http.Client, server bbapi.ServerConfiguration) APIClient
NewCloudAPIClientWithConfigurations creates client for Bitbucket Cloud Insights API with specified configuration
func NewServerAPIClient ¶ added in v0.13.0
func NewServerAPIClient() APIClient
NewServerAPIClient creates client for Bitbucket Server Code Insights API
type AnnotationsRequest ¶ added in v0.13.0
type AnnotationsRequest struct { Owner string Repository string Commit string ReportID string Comments []*reviewdog.Comment }
AnnotationsRequest is an object that represent parameters used to create/update annotations
type CloudAPIClient ¶ added in v0.13.0
type CloudAPIClient struct {
// contains filtered or unexported fields
}
CloudAPIClient is wrapper for Bitbucket Cloud Code Insights API client
func (*CloudAPIClient) CreateOrUpdateAnnotations ¶ added in v0.13.0
func (c *CloudAPIClient) CreateOrUpdateAnnotations(ctx context.Context, req *AnnotationsRequest) error
CreateOrUpdateAnnotations creates or updates annotations
func (*CloudAPIClient) CreateOrUpdateReport ¶ added in v0.13.0
func (c *CloudAPIClient) CreateOrUpdateReport(ctx context.Context, req *ReportRequest) error
CreateOrUpdateReport creates or updates specified report
type CloudAPIHelper ¶ added in v0.13.0
type CloudAPIHelper struct{}
CloudAPIHelper is collection of utility functions used to build requests for Bitbucket Cloud Code Insights API
func (*CloudAPIHelper) BuildAnnotations ¶ added in v0.13.0
func (c *CloudAPIHelper) BuildAnnotations(comments []*reviewdog.Comment) []bbapi.ReportAnnotation
BuildAnnotations builds list of Code Insights API annotation objects for specified comments
func (*CloudAPIHelper) BuildReport ¶ added in v0.13.0
func (c *CloudAPIHelper) BuildReport(req *ReportRequest) bbapi.Report
BuildReport builds Code Insights API report object
type ReportAnnotator ¶
type ReportAnnotator struct {
// contains filtered or unexported fields
}
ReportAnnotator is a comment service for Bitbucket Code Insights reports.
Cloud API:
https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Bworkspace%7D/%7Brepo_slug%7D/commit/%7Bcommit%7D/reports/%7BreportId%7D/annotations#post POST /2.0/repositories/{username}/{repo_slug}/commit/{commit}/reports/{reportId}/annotations
Server API:
https://docs.atlassian.com/bitbucket-server/rest/5.15.0/bitbucket-code-insights-rest.html#idm288218233536 /rest/insights/1.0/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/reports/{key}/annotations
func NewReportAnnotator ¶
func NewReportAnnotator(cli APIClient, owner, repo, sha string, runners []string) *ReportAnnotator
NewReportAnnotator creates new Bitbucket ReportRequest Annotator
type ReportRequest ¶ added in v0.13.0
type ReportRequest struct { Owner string Repository string Commit string ReportID string Type string Title string Reporter string Result string Details string LogoURL string }
ReportRequest is an object that represent parameters used to create/update report
type ServerAPIClient ¶ added in v0.13.0
type ServerAPIClient struct {
// contains filtered or unexported fields
}
ServerAPIClient is wrapper for Bitbucket Server Code Insights API client
func (*ServerAPIClient) CreateOrUpdateAnnotations ¶ added in v0.13.0
func (c *ServerAPIClient) CreateOrUpdateAnnotations(ctx context.Context, req *AnnotationsRequest) error
CreateOrUpdateAnnotations creates or updates annotations
func (*ServerAPIClient) CreateOrUpdateReport ¶ added in v0.13.0
func (c *ServerAPIClient) CreateOrUpdateReport(ctx context.Context, req *ReportRequest) error
CreateOrUpdateReport creates or updates specified report
type ServerAPIHelper ¶ added in v0.13.0
type ServerAPIHelper struct{}
ServerAPIHelper is collection of utility functions used to build requests for Bitbucket Server Code Insights API
func (*ServerAPIHelper) BuildAnnotations ¶ added in v0.13.0
func (h *ServerAPIHelper) BuildAnnotations(comments []*reviewdog.Comment) insights.AnnotationsList
BuildAnnotations builds list of Code Insights API annotation objects for specified comments
func (*ServerAPIHelper) BuildReport ¶ added in v0.13.0
func (h *ServerAPIHelper) BuildReport(req *ReportRequest) insights.Report
BuildReport builds Code Insights API report object
type UnexpectedResponseError ¶ added in v0.13.0
UnexpectedResponseError is triggered when we have unexpected response from Code Insights API
func (UnexpectedResponseError) Error ¶ added in v0.13.0
func (e UnexpectedResponseError) Error() string